| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 559624 | Trunkty | ZigZag (COCI17_zigzag) | C++14 | 65 ms | 7988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
#define debug(x) cout << #x << ": " << x << endl
#else
#define debug(x)
#endif
int k,n;
deque<string> arr[205];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> k >> n;
for(int i=1;i<=k;i++){
string s;
cin >> s;
arr[s[0]].push_back(s);
}
for(int i=1;i<=200;i++){
sort(arr[i].begin(),arr[i].end());
}
for(int i=1;i<=n;i++){
string s;
cin >> s;
string a = arr[s[0]].front();
arr[s[0]].pop_front();
arr[s[0]].push_back(a);
cout << a << "\n";
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
