Submission #82795

#TimeUsernameProblemLanguageResultExecution timeMemory
82795xiaowuc1Karte (COCI15_karte)C++14
50 / 50
3 ms792 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; string s; int ret[256]; int main() { cin >> s; ret['P'] = 13; ret['K'] = 13; ret['H'] = 13; ret['T'] = 13; set<string> ss; for(int i = 0; i < s.length(); i += 3) { if(ss.count(s.substr(i, 3))) { printf("GRESKA\n"); return 0; } ss.insert(s.substr(i, 3)); ret[s[i]]--; } printf("%d %d %d %d\n", ret['P'], ret['K'], ret['H'], ret['T']); }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:17:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < s.length(); i += 3) {
                 ~~^~~~~~~~~~~~
karte.cpp:23:11: warning: array subscript has type 'char' [-Wchar-subscripts]
   ret[s[i]]--;
           ^
#Verdict Execution timeMemoryGrader output
Fetching results...