Submission #23190

#TimeUsernameProblemLanguageResultExecution timeMemory
23190model_codeKarte (COCI15_karte)C++11
50 / 50
0 ms2020 KiB
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int MAXB = 5; const int MAXN = 20; bool bio[MAXB][MAXN]; int getColor(char chr) { if (chr == 'P') return 0; if (chr == 'K') return 1; if (chr == 'H') return 2; if (chr == 'T') return 3; } int main(void) { string s; cin >> s; 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 (bio[b][x]) { printf("GRESKA\n"); return 0; } bio[b][x] = true; } for (int i = 0; i < 4; ++i) { int cnt = 0; for (int j = 1; j <= 13; ++j) if (bio[i][j]) ++cnt; printf("%d ",13 - cnt); } printf("\n"); return 0; }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:22:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < s.size(); i += 3) {
                     ^
karte.cpp: In function 'int getColor(char)':
karte.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...