# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
708347 | lalig777 | Karte (COCI15_karte) | C++14 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size()/3, P=13, K=13, H=13, T=13;
vector<vector<bool>>rep(4, vector<bool>(13, false));
for (int i=0; i<n; i++){
int a=s[i*3+1]-'0', b=s[i*3+2]-'0';
int card=a*10+b;
if (s[i*3]=='P'){
if (rep[0][card-1]==true){
cout<<"GRESKA\n";
return 0;
}else{
rep[0][card-1]=true;
P--;
}
}else if (s[i*3]=='K'){
if (rep[1][card-1]==true){
cout<<"GRESKA\n";
return 0;
}else{
rep[1][card-1]=true;
K--;
}
}else if (s[i*3]=='H'){
if (rep[2][card-1]==true){
cout<<"GRESKA\n";
return 0;
}else{
rep[2][card-1]=true;
H--;
}
}else{
if (rep[3][card-1]==true){
cout<<"GRESKA\n";
return 0;
}else{
rep[3][card-1]=true;
T--;
}
}
}cout<<P<<" "<<K<<" "<<H<<" "<<T<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |