# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153868 | Divia | Karte (COCI15_karte) | C++14 | 2 ms | 380 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 <iostream>
using namespace std;
//ifstream cin("karte.in");
//ofstream cout("karte.out");
int i,j,t,lipsa,nr;
char s[2000];
int v[5][20];
int main()
{
cin.getline(s,1000);
for(i=0;s[i];i+=3){
if(s[i]=='P')t=1;
else if(s[i]=='K')t=2;
else if(s[i]=='H')t=3;
else if(s[i]=='T')t=4;
nr=(s[i+1]-'0')*10+s[i+2]-'0';
if(v[t][nr]==1){cout<<"GRESKA";return 0;}
v[t][nr]=1;
}
for(i=1;i<=4;i++){
lipsa=13;
for(j=1;j<=13;j++)
if(v[i][j])lipsa--;
cout<<lipsa<<" ";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |