# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153878 | 2019-09-17T07:53:04 Z | mihnea_anghel | Karte (COCI15_karte) | C++17 | 0 ms | 0 KB |
#include <iostream> #include <cstring> using namespace std; char s[1100], x; int n, i, nr, a[200][20]; int main() { /// P K H T cin>>s; for ( i=0; s[i]; i+=3 ){ x = s[i]; nr = (s[i+1]-'0')*10+(s[i+2]-'0'); if ( a[x-'A'][nr] != 0 ){ g<<"GRESKA"; return 0; } a[x-'A'][nr] = 1; a[x-'A'][0]++; } cout<<13-a['P'-'A'][0]<<" "<<13-a['K'-'A'][0]<<" "<<13-a['H'-'A'][0]<<" "<<13-a['T'-'A'][0]; return 0; }