Submission #646121

#TimeUsernameProblemLanguageResultExecution timeMemory
646121AdominatorKarte (COCI15_karte)C++17
50 / 50
1 ms320 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ar array #define vo vector #define pb push_back #define all(x) begin(x), end(x) #define sz(x) (ll)(x).size() #define rep(i, a, b) for(ll i=(a); i<(b); i++) #define repd(i, a, b) for(ll i=(a); i>=(b); i--) int main() { cin.tie(0)->sync_with_stdio(0); string s; cin >> s; unordered_map<char, int> mp; mp['P']=0, mp['K']=1, mp['H']=2, mp['T']=3; vo<vo<int>> suite(4, vo<int>(14)); rep(i, 0, sz(s)-2) suite[mp[s[i]]][10*(s[i+1]-'0')+s[i+2]-'0']++, i+=2; vo<int> ans; rep(i, 0, 4) { int cnt=0; rep(j, 1, 14) if(suite[i][j]>1) { cout << "GRESKA"; return 0; } else if(!suite[i][j]) cnt++; ans.pb(cnt); } for(auto i: ans) cout << i << ' '; }
#Verdict Execution timeMemoryGrader output
Fetching results...