# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105875 | leonarda | Kartomat (COCI17_kartomat) | C++14 | 3 ms | 512 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;
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pi;
typedef long long int lint;
const int inf = 0x3f3f3f3f;
const int maxn = 0;
int n;
char tip[4][8];
string s[55];
string poc;
bool moze[30];
bool fuki(string t) {
for(int i = 0; i < poc.size(); ++i)
if(t[i] != poc[i])
return 0;
return 1;
}
int main ()
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
tip[0][0] = tip[0][1] = tip[0][2] = tip[3][7] = tip[3][6] = tip[3][5] = '*';
int cur = 0;
for(int i = 0; i < 4; ++i) {
for(int j = 0; j < 8; ++j) {
if(tip[i][j] != '*') {
tip[i][j] = cur + 'A';
++cur;
}
}
}
cin >> n;
for(int i = 0; i < n; ++i)
cin >> s[i];
cin >> poc;
for(int i = 0; i < n; ++i)
if(fuki(s[i]))
moze[s[i][poc.size()] - 'A'] = 1;
for(int i = 0; i < 4; ++i) {
for(int j = 0; j < 8; ++j) {
if(tip[i][j] != '*') if( ! moze[tip[i][j] - 'A'])
tip[i][j] = '*';
cout << tip[i][j];
}
cout << endl;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |