Submission #470573

#TimeUsernameProblemLanguageResultExecution timeMemory
470573KarabasanKarte (COCI15_karte)C++17
10 / 50
1 ms292 KiB
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define forcin for(int i=1;i<=n;i++) scanf("%d",&dizi[i]); #define forcout for(int i=0;i<n;i++) printf("%d ",dizi[i]); #define ll long long using namespace std; string s; map <string ,int> mp; int p=13,k=13,h=13,t=13; int main() { cin>>s; for(int i=0;i<s.length();i++) { if(i%3==0) { if(s[i]=='P') p--; if(s[i]=='K') k--; if(s[i]=='H') h--; if(s[i]=='T') t--; } char dizi[3]={s[i],s[i+1],s[i+2]}; string a=dizi; if(mp[a]!=0) { cout<<"GRESKA"; return 0; } mp[a]++; } cout<<p<<" "<<k<<" "<<h<<" "<<t<<" "; return 0; } /* ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀ ⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀ ⠀⠀⢳⡀ ⡏⠀⠀⠀⠀⠀⢷ ⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀⠀⠀ ⡇ ⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀⣸⠀⠀Ez⠀ ⡇ ⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀ ⠀⣿⠀⢹⠀⠀⠀⠀⠀ ⡇ ⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀⡇⠀⠀⠀⠀⡼ ⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀⠘⠤⣄⣠⠞⠀ ⠀⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀ ⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀ ⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀⠀⣄⢸⠀⠀⠀⠀⠀⠀ ⣿⣿⣧⣀⣿.........⣀⣰⣏⣘⣆⣀⠀⠀ ░██████╗░█████╗░██╗████████╗░█████╗░███╗░░░███╗░█████╗░ ██╔════╝██╔══██╗██║╚══██╔══╝██╔══██╗████╗░████║██╔══██╗ ╚█████╗░███████║██║░░░██║░░░███████║██╔████╔██║███████║ SENSEI ░╚═══██╗██╔══██║██║░░░██║░░░██╔══██║██║╚██╔╝██║██╔══██║ ██████╔╝██║░░██║██║░░░██║░░░██║░░██║██║░╚═╝░██║██║░░██║ ╚═════╝░╚═╝░░╚═╝╚═╝░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝ */

Compilation message (stderr)

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