Submission
Status:
[PxSSS][TSSSS]
Subtask/Task Score:
{0/50}{0/50}
Score: 0
User: Seng
Problemset: จุดแวะพัก
Language: cpp
Time: 1.091 second
Submitted On: 2026-05-26 23:19:36
#include <bits/stdc++.h>
using namespace std;
using pir = pair<int, string>;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int n, k;cin >> n >> k;
//string str2; cin >> str2;
priority_queue<pir, vector<pir>, greater<pir>> ans;
int ss = 0;
string str2;cin >> str2;
while(n--){
string str = str2;
int cnt = 0;
bool chk = false;
int x;cin >> x;
str2 = '1';
while('9' - str2[0] >= 0){
if(n == 0 && x > k){
ss = min(3, ss);
while(ss--){
string str = ans.top().second;
ans.pop();
cout << str << " ";
}
return 0;
}
if(x < k) cnt++;
else if(x == k){
ans.push({cnt, str});
chk = true;
}
else chk = true;
cin >> str2;
x = str2[0]-'0';
}
ss++;
//cout << cnt << " " << str << '\n';
}
}