# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
919517 | TIN | Karte (COCI15_karte) | C++17 | 1 ms | 708 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 FNAME "test"
#define ERR "GRESKA"
string s;
bool b[4][13];
void Task() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cout << fixed << setprecision(9);
if (fopen(FNAME".inp","r")) {
freopen(FNAME".inp","r",stdin);
freopen(FNAME".out","w",stdout);
}
}
void Solve() {
//Your Code
auto id = [&](char t) -> int {
if (t == 'P') return 0;
if (t == 'K') return 1;
if (t == 'H') return 2;
return 3;
};
memset(b, false, sizeof(b));
cin >> s;
for (int i = 0; i < (int) s.size(); i += 3) {
char t = s[i];
int type = id(t);
int num = 10 * (s[i + 1] - '0') + (s[i + 2] - '0');
num--;
if (b[type][num]) {
cout << ERR;
return;
}
b[type][num] = true;
}
for (int type = 0; type < 4; type++) {
int res = 13;
for (int num = 0; num < 13; num++) {
res -= b[type][num];
}
cout << res << " ";
}
}
int main() {
Task();
Solve();
cerr << "\nTime run: " << 1000*clock()/CLOCKS_PER_SEC << "ms";
return 37^37;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |