# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382921 | Iwanttobreakfree | Karte (COCI15_karte) | C++17 | 1 ms | 364 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>
#include <vector>
using namespace std;
int main(){
char c;
bool pos=true;
int n;
vector<vector<bool> >v(4,vector<bool> (13));
for(int i=0;i<4;i++){
for(int j=0;j<13;j++){
v[i][j]=false;
}
}
while(cin>>c){
cin>>n;
n--;
if(c=='P'){
if(!v[0][n])v[0][n]=true;
else {
pos=false;
break;
}
}
else if(c=='K'){
if(!v[1][n])v[1][n]=true;
else {
pos=false;
break;
}
}
else if(c=='H'){
if(!v[2][n])v[2][n]=true;
else {
pos=false;
break;
}
}
else{
if(!v[3][n])v[3][n]=true;
else {
pos=false;
break;
}
}
}
int cont=0;
if(!pos)cout<<"GRESKA\n";
else {
for(int i=0;i<4;i++){
cont=0;
for(int j=0;j<13;j++){
if(!v[i][j])cont++;
}
cout<<cont<<' ';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |