Submission #154277

#TimeUsernameProblemLanguageResultExecution timeMemory
154277denmirceaKarte (COCI15_karte)C++14
50 / 50
3 ms376 KiB
#include <iostream> using namespace std; int i,n,ok,x,nr,d,y,j,k,v[1001]; short fr[200][30]; int sum[200]; string s; int main(){ cin>>s; for(i=0;s[i]!=0;i+=3){ nr=(s[i+1]-48)*10+ s[i+2]-48; fr[s[i]][nr]++; if(fr[s[i]][nr]>1){ cout<<"GRESKA"; return 0; } sum[s[i]]++; } cout<<13-sum['P']<<" "<<13-sum['K']<<" "<<13-sum['H']<<" "<<13-sum['T']; }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:11:12: warning: array subscript has type 'char' [-Wchar-subscripts]
     fr[s[i]][nr]++;
            ^
karte.cpp:12:15: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(fr[s[i]][nr]>1){
               ^
karte.cpp:16:13: warning: array subscript has type 'char' [-Wchar-subscripts]
     sum[s[i]]++;
             ^
#Verdict Execution timeMemoryGrader output
Fetching results...