# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
964255 |
2024-04-16T13:41:42 Z |
pcc |
Karte (COCI15_karte) |
C++17 |
|
1 ms |
456 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
string s;
map<char,vector<int>> mp;
map<char,int> cnt;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>s;
for(int i = 0;i<s.size();i+=3){
int tmp = stoi(s.substr(i+1,2));
mp[s[i]].push_back(tmp);
}
for(auto &i:mp){
sort(i.sc.begin(),i.sc.end());
for(int j = 1;j<i.sc.size();j++){
if(i.sc[j] == i.sc[j-1]){
cout<<"GRESKA\n";
return 0;
}
}
}
cout<<13-mp['P'].size()<<' '<<13-mp['K'].size()<<' '<<13-mp['H'].size()<<' '<<13-mp['T'].size()<<'\n';
return 0;
}
Compilation message
karte.cpp: In function 'int main()':
karte.cpp:19:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
19 | for(int i = 0;i<s.size();i+=3){
| ~^~~~~~~~~
karte.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
25 | for(int j = 1;j<i.sc.size();j++){
| ~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
456 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |