Submission #920596

#TimeUsernameProblemLanguageResultExecution timeMemory
920596SuPythonyKamenčići (COCI21_kamencici)C++17
0 / 70
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,k; cin>>n>>k; string s; cin>>s; int turn=0; int l=0, r=n-1; vector<int> peb(2, 0); while (peb[0]<k&&l<r) { if (turn==1&&s[l]=='C'&&s[r]=='C'&&peb[1]==k-1) { cout<<"DA"; return 0; } if (s[l]=='P'&&s[r]=='P') { if (s[l+1]=='C') { l++; } else { r--; } } else if (s[l]=='P') { l++; } else if (s[r]=='P') { r--; } else { if (s[l+1]=='C') { l++; } else { r--; } peb[turn]++; } turn=!turn; } cout<<"NE"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...