제출 #253054

#제출 시각아이디문제언어결과실행 시간메모리
253054SprdaloKarte (COCI15_karte)C++17
50 / 50
1 ms384 KiB
#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) 메시지

karte.cpp: In function 'll f(char)':
karte.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...