Submission #165812

#TimeUsernameProblemLanguageResultExecution timeMemory
165812ArKCaKarte (COCI15_karte)C++17
50 / 50
2 ms376 KiB
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define pob pop_back #define N 10 using namespace std; char c; int a,a1,a2,a3,a4; int b1[20],b2[20],b3[20],b4[20]; int main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); while(1){ scanf("%c",&c); if(c=='\n')break; scanf("%d",&a); if(c=='P'){ a1++; if(b1[a]==1){ printf("GRESKA\n"); return 0; } b1[a]=1; } else if(c=='K'){ a2++; if(b2[a]==1){ printf("GRESKA\n"); return 0; } b2[a]=1; } else if(c=='H'){ a3++; if(b3[a]==1){ printf("GRESKA\n"); return 0; } b3[a]=1; } else if(c=='T'){ a4++; if(b4[a]==1){ printf("GRESKA\n"); return 0; } b4[a]=1; } } printf("%d %d %d %d\n",13-a1,13-a2,13-a3,13-a4); }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%c",&c);
   ~~~~~^~~~~~~~~
karte.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a);
   ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...