Submission #555369

#TimeUsernameProblemLanguageResultExecution timeMemory
555369new_accKarte (COCI15_karte)C++14
50 / 50
1 ms340 KiB
#include<bits/stdc++.h> #define fi first #define se second #define pitem item* using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; const int N=1e6+10; const int SS=1<<19; const int INFi=2e9; const ll INFl=1e13; const ll mod2=998244353; const ll mod=1e9+7; const ll mod3=1000696969; const ll p=70032301; const ull p2=913; const int L=20; int t[N],t2[N],t3[N],t4[N]; void solve(){ string s; cin>>s; bool res=1; for(int i=2;i<s.size();i+=3){ int curr=int(s[i-1])-48; curr*=10; curr+=int(s[i])-48; if(s[i-2]=='P'){ if(t[curr]) res=0; else t[curr]=1; }else{ if(s[i-2]=='K'){ if(t2[curr]) res=0; else t2[curr]=1; }else{ if(s[i-2]=='H'){ if(t3[curr]) res=0; else t3[curr]=1; }else{ if(t4[curr]) res=0; else t4[curr]=1; } } } } if(!res){ cout<<"GRESKA\n"; return; } int res1=0,res2=0,res3=0,res4=0; for(int i=1;i<=13;i++){ if(!t[i]) res1++; if(!t2[i]) res2++; if(!t3[i]) res3++; if(!t4[i]) res4++; } cout<<res1<<" "<<res2<<" "<<res3<<" "<<res4<<"\n"; } int main(){ ios_base::sync_with_stdio(0),cin.tie(0); int tt=1; while(tt--) solve(); }

Compilation message (stderr)

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