# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168872 | Asamu13 | Karte (COCI15_karte) | C++14 | 2 ms | 376 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>
#define inf INT_MAX
#define sc(a) scanf("%d",&a)
#define scc(a,b) scanf("%d %d",&a,&b)
#define sccc(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pf(a) printf("%d",a)
#define pff(a,b) printf("%d %d",a,b)
#define pfff(a,b,c) printf("%d %d %d",a,b,c)
#define pb(a) push_back(a)
#define em empty()
#define fr front()
#define cl clear()
#define sz size()
#define mp(a,b) make_pair(a,b)
#define fri(b) freopen(b,"r",stdin)
#define fro(b) freopen(b,"w",stdout)
/*
ID: uslusam1
TASK: test
LANG: C++
*/
using namespace std;
set<string> setp;
set<string> setk;
set<string> seth;
set<string> sett;
int main(){
//fri("gir.txt");
//fro("cik.txt");
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string st,st1;
cin>>st;
for(int i=0;i<=st.size()-1;i+=3){
if(st[i]=='P'){
st1=st.substr(i,3);
if(setp.count(st1)!=0){
cout<<"GRESKA";
return 0;
}
setp.insert(st1);
}
if(st[i]=='K'){
st1=st.substr(i,3);
if(setk.count(st1)!=0){
cout<<"GRESKA";
return 0;
}
else{
setk.insert(st1);
}
}
if(st[i]=='H'){
st1=st.substr(i,3);
if(seth.count(st1)!=0){
cout<<"GRESKA";
return 0;
}
seth.insert(st1);
}
if(st[i]=='T'){
st1=st.substr(i,3);
if(sett.count(st1)!=0){
cout<<"GRESKA";
return 0;
}
sett.insert(st1);
}
}
cout<<13-setp.size()<<" "<<13-setk.size()<<" "<<13-seth.size()<<" "<<13-sett.size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |