Submission #964278

#TimeUsernameProblemLanguageResultExecution timeMemory
964278PringKarte (COCI15_karte)C++17
50 / 50
1 ms352 KiB
#include <bits/stdc++.h> using namespace std; #ifdef MIKU string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m"; #define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x) void dout() { cout << dbrs << endl; } template <typename T, typename ...U> void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); } #else #define debug(...) 39 #endif #define fs first #define sc second #define mp make_pair #define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++) using ll = long long; typedef pair<int, int> pii; string s; map<char, set<string>> M; void miku() { cin >> s; for (int i = 0; i < s.size(); i += 3) { char c = s[i]; string t = s.substr(i + 1, 2); if (!M[c].insert(t).sc) { cout << "GRESKA" << '\n'; return; } } auto f = [&](char c) -> int { return 13 - M[c].size(); }; cout << f('P') << ' ' << f('K') << ' ' << f('H') << ' ' << f('T') << '\n'; } int32_t main() { cin.tie(0) -> sync_with_stdio(false); cin.exceptions(cin.failbit); miku(); return 0; }

Compilation message (stderr)

karte.cpp: In function 'void miku()':
karte.cpp:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for (int i = 0; i < s.size(); i += 3) {
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...