제출 #168872

#제출 시각아이디문제언어결과실행 시간메모리
168872Asamu13Karte (COCI15_karte)C++14
50 / 50
2 ms376 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

karte.cpp: In function 'int main()':
karte.cpp:39:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<=st.size()-1;i+=3){
              ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...