| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 253054 | Sprdalo | Karte (COCI15_karte) | C++17 | 1 ms | 384 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 int ll
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;
int cnt[4][14];
/*
P - 0
K - 1
H - 2
T - 3
*/
int con(string s){
    int x = (s[0] - '0') * 10 + (s[1] - '0');
    return x;
}
int f(char c){
    if (c == 'P') return 0;
    if (c == 'K') return 1;
    if (c == 'H') return 2;
    if (c == 'T') return 3;
}
void no(){
    cout << "GRESKA\n";
    exit(0);
}
signed main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr); 
    cerr.tie(nullptr);    
    string s;
    cin >> s;
    int n = s.length();
    for (int i = 0; i < n; i += 3){
        string t = "";
        t += s[i + 1];
        t += s[i + 2];
        int x = con(t), y = f(s[i]);
        if (cnt[y][x]){
            no();
        }
        ++cnt[y][x];
    }
    for (int i = 0; i < 4; ++i){
        int sol = 13;
        for (int j = 1; j <= 13; ++j){
            sol -= cnt[i][j];
        }
        cout << sol << ' '; 
    }
    cout << '\n';
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
