# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
994024 | vjudge1 | Kartomat (COCI17_kartomat) | C++17 | 1 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string a[n];
for (int i = 0; i < n; i ++)
cin >> a[i];
string s;
cin >> s;
vector<int> possible;
for (int i = 0; i < n; i ++){
if (a[i].size() <= s.size()) continue;
bool bad = 0;
for (int j = 0; j < s.size(); j ++){
if (a[i][j] != s[j]){
bad = 1;
}
}
if (bad) continue;
possible.push_back(a[i][s.size()] - 'A' + 3);
}
char mat[4][8];
for (int i = 0; i < 4; i ++)
for (int j = 0; j < 8; j ++)
mat[i][j] = '*';
for (int x : possible){
char ch = char(x - 3 + 'A');
int r = x / 8;
int c = x % 8;
mat[r][c] = ch;
}
for (int i = 0; i < 4; i ++){
for (int j = 0; j < 8; j ++)
cout << mat[i][j];
cout << endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |