Submission #499431

#TimeUsernameProblemLanguageResultExecution timeMemory
499431Alisaf9Kamenčići (COCI21_kamencici)C++14
0 / 70
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,k,f1=0,f2=0,s1=0,s2=0; cin>>n>>k; string s; cin>>s; for(int i=0;i<s.size();i++) { if(i%2==0) { if(s[i]=='C') f1++; } if(i%2==1) { if(s[i]=='C') s1++; } if(f1==k||s1==k) { break; } } int y=(s.size()-1)%2; for(int i=s.size()-1;i>=0;i--) { if(i%2==y) { if(s[i]=='C') f2++; } if(i%2!=y) { if(s[i]=='C') s2++; } if(f2==k||s2==k) { break; } } if(f1<s1||f2<s2) { cout<<"DA"; } else if(f1>s1&&f2>s2) cout<<"NE"; return 0; }

Compilation message (stderr)

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