Submission #156123

#TimeUsernameProblemLanguageResultExecution timeMemory
156123MosesKarte (COCI15_karte)C++14
50 / 50
3 ms380 KiB
// Created by AboAbdoMC #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define db1(x) cout<<#x<<"="<<x<<'\n' #define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n' #define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n' #define rep(i,n) for(int i=0;i<(n);++i) #define repA(i,a,n) for(int i=a;i<=(n);++i) #define repD(i,a,n) for(int i=a;i>=(n);--i) #define f first #define s second #define pb push_back #define mp make_pair #define ll long long using namespace std; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set; const int OO = 1e9+7; const int MOD = 1e9+7; const int N = 1e5+7; set<string> st; map<char,int> cnt; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; cin >> s; int i = 0; while(i < s.size()) { string tmp = s.substr(i,3); if (st.find(tmp) != st.end()) { cout << "GRESKA\n"; return 0; } st.insert(tmp); i+=3; } for(auto str:st) { cnt[str[0]]++; } cout << 13-cnt['P'] << ' ' << 13-cnt['K'] << ' ' << 13-cnt['H'] << ' ' << 13-cnt['T'] << '\n'; return 0; }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:37:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(i < s.size())
           ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...