Submission #499480

#TimeUsernameProblemLanguageResultExecution timeMemory
499480Alisaf9Kamenčići (COCI21_kamencici)C++14
0 / 70
0 ms204 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,k,w=0,q=0,m=0,f=0; string s; cin>>n>>k; cin>>s; for(int i=0;i<n;i++) { if(s[i]=='P') { q++; } if(s[i]=='C') break; } for(int i=n-1;i>=0;i--) { if(s[i]=='P') { f++; } else break; } m=f+q; if(m%2==1) cout<<"DA"; else cout<<"NE"; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:7:13: warning: unused variable 'w' [-Wunused-variable]
    7 |     int n,k,w=0,q=0,m=0,f=0;
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...