# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
253054 | Sprdalo | Karte (COCI15_karte) | C++17 | 1 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int ll
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;
int cnt[4][14];
/*
P - 0
K - 1
H - 2
T - 3
*/
int con(string s){
int x = (s[0] - '0') * 10 + (s[1] - '0');
return x;
}
int f(char c){
if (c == 'P') return 0;
if (c == 'K') return 1;
if (c == 'H') return 2;
if (c == 'T') return 3;
}
void no(){
cout << "GRESKA\n";
exit(0);
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
string s;
cin >> s;
int n = s.length();
for (int i = 0; i < n; i += 3){
string t = "";
t += s[i + 1];
t += s[i + 2];
int x = con(t), y = f(s[i]);
if (cnt[y][x]){
no();
}
++cnt[y][x];
}
for (int i = 0; i < 4; ++i){
int sol = 13;
for (int j = 1; j <= 13; ++j){
sol -= cnt[i][j];
}
cout << sol << ' ';
}
cout << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |