# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
739994 | unexpectedbro | Karte (COCI15_karte) | C++14 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(nullptr);
#define ll long long
#define pb push_back
#define all(a) a.begin(),a.end()
/*
3
P01K02H03H04
H02H10P11H02
P10K10H10T01
*/
const int maxn=20;
bool vis[maxn][maxn];
int getcolor(char c){
if(c=='P'){
return 0;
}
if(c=='K'){
return 1;
}
if(c=='H'){
return 2;
}
if(c=='T'){
return 3;
}
}
void solve()
{
string s;
cin >> s;
for(int i=0;i<20;i++){
for(int j=0;j<20;j++){
vis[i][j]=0;
}
}
for(int i=0;i<s.size();i+=3){
int b=getcolor(s[i]);
int x=(s[i+1]-'0')*10+(s[i+2]-'0');
if(vis[b][x]){
cout<<"GRESKA"<<endl;
return;
}
vis[b][x]=true;
}
for(int i=0;i<4;i++){
int cnt=0;
for(int j=1;j<=13;j++){
cnt+=vis[i][j];
}
cout<<13-cnt<<" ";
}
cout<<endl;
}
int main()
{
fast
int tc;
cin >> tc;
while (tc--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |