# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
384620 |
2021-04-01T22:45:50 Z |
vulpes |
Karte (COCI15_karte) |
C++17 |
|
2 ms |
364 KB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
string s; cin >> s;
map<string,bool> m;
for (int i = 0; i < s.size(); i += 3) {
if (m[s.substr(i, 3)]) {
return cout << "GRESKA" << endl, 0;
}
m[s.substr(i, 3)] = true;
}
vector<char> a = {'P', 'K', 'H', 'T'};
for (char i : a) {
int c = count(s.begin(), s.end(), i);
cout << 13 - c << " ";
}
return 0;
}
Compilation message
karte.cpp: In function 'int main()':
karte.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
9 | for (int i = 0; i < s.size(); i += 3) {
| ~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |