# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650103 | 2022-10-12T12:43:09 Z | berr | Karte (COCI15_karte) | C++17 | 1 ms | 212 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); /*#ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif */ string s; cin>>s; int f=s.size()/3; set<string> q[4]; for(int i=0; i<s.size(); i+=3) { string h=s.substr(i+1, 2); if(s[i]=='P') q[0].insert(h); else if(s[i]=='K') q[1].insert(h); else if(s[i]=='H') q[2].insert(h); else q[3].insert(h); } if((s.size()/3)!=(q[3].size()+q[2].size()+q[1].size()+q[0].size())) { cout<<"GRESKA"; } else { for(int i=0; i<4; i++) { cout<<13-q[i].size()<<" "; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 212 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 1 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |