#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<<' ';
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |