# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
739995 | 2023-05-11T19:54:10 Z | unexpectedbro | Karte (COCI15_karte) | C++14 | 1 ms | 212 KB |
#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=1; //cin >> tc; while (tc--) { solve(); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |