# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1104422 | qrn | Karte (COCI15_karte) | C++14 | 1 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
template<class ISqr, class T>
ISqr& operator>>(ISqr& is, vector<T>& v) { for (auto& x : v) is >> x; return is; }
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
template <typename T>
void show(vector<T> &v) {
for (T i : v) {
cout << i << ' ';
}
cout << endl;
}
#define pb push_back
#define ins insert
#define fi first
#define se second
#define endl "\n"
#define ALL(x) x.begin(), x.end()
#define sz(x) x.size()
#define int long long
#define _ << " " <<
#define no cout << "No" << endl;
#define yes cout << "Yes" << endl;
#define impos cout << -1 << endl;
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
void solve() {
string s;
cin >> s;
map<pair<char,int>,int>deck;
map<char,int>cnt;
cnt['P'] = 0; cnt['K'] = 0; cnt['H'] = 0; cnt['T'] = 0;
for(int i = 0; i < sz(s); i += 3) {
cnt[s[i]]++;
int num = (s[i+1] - 48) * 10 + (s[i+2] - 48);
deck[{s[i], num}]++;
}
for(auto it : deck) {
if(it.se >= 2) {
cout << "GRESKA" << endl;
return;
}
}
cout << 13 - cnt['P'] _ 13 - cnt['K'] _ 13 - cnt['H'] _ 13 - cnt['T'] << endl;
cout << endl;
}
signed main(){
SPEED;
int t = 1;
// cin >> t;
for(int cs = 1; cs <= t; cs++) {
solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |