# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153845 | Ruxandra985 | Karte (COCI15_karte) | C++14 | 2 ms | 504 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 <cstdio>
#include <set>
using namespace std;
set <int> s[4];
int main()
{
FILE *fin = stdin;
FILE *fout = stdout;
int nr;
char c;
c = fgetc (fin);
while (c=='P' || c =='K' || c == 'H' || c =='T'){
nr = (fgetc(fin)-'0') * 10 + (fgetc(fin)-'0');
if (c == 'P'){
if (s[0].find(nr) != s[0].end()){
fprintf (fout,"GRESKA");
return 0;
}
s[0].insert(nr);
}
else if (c == 'K'){
if (s[1].find(nr) != s[1].end()){
fprintf (fout,"GRESKA");
return 0;
}
s[1].insert(nr);
}
else if (c == 'H'){
if (s[2].find(nr) != s[2].end()){
fprintf (fout,"GRESKA");
return 0;
}
s[2].insert(nr);
}
else if (c == 'T'){
if (s[3].find(nr) != s[3].end()){
fprintf (fout,"GRESKA");
return 0;
}
s[3].insert(nr);
}
c = fgetc(fin);
}
fprintf (fout,"%d %d %d %d" , 13 - s[0].size() , 13 - s[1].size() , 13 - s[2].size() , 13 - s[3].size() );
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |