# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
447308 | 2021-07-26T03:40:07 Z | dvtd | ZigZag (COCI17_zigzag) | C++14 | 88 ms | 9668 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; vector<string> _list[50]; int idx[50]; int n, m; int main() { cin >> n >> m; for (int i = 0; i < n; ++i) { string tmp; cin >> tmp; idx[tmp[0] - 'a'] = 0; _list[tmp[0] - 'a'].push_back(tmp); } for (int i = 0; i <= 27; ++i) sort(_list[i].begin(),_list[i].end()); for (int i = 0; i < m; ++i) { char tmp; cin >> tmp; cout << _list[tmp - 'a'][idx[tmp]] << endl; idx[tmp] =(idx[tmp] + 1) % (int)(_list[tmp - 'a'].size()); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 292 KB | Execution killed with signal 11 |
2 | Runtime error | 1 ms | 332 KB | Execution killed with signal 11 |
3 | Runtime error | 1 ms | 460 KB | Execution killed with signal 11 |
4 | Runtime error | 2 ms | 460 KB | Execution killed with signal 11 |
5 | Runtime error | 1 ms | 460 KB | Execution killed with signal 11 |
6 | Runtime error | 2 ms | 460 KB | Execution killed with signal 11 |
7 | Runtime error | 84 ms | 9668 KB | Execution killed with signal 11 |
8 | Runtime error | 83 ms | 9552 KB | Execution killed with signal 11 |
9 | Runtime error | 88 ms | 9668 KB | Execution killed with signal 11 |
10 | Runtime error | 84 ms | 9596 KB | Execution killed with signal 11 |