Submission #662958

#TimeUsernameProblemLanguageResultExecution timeMemory
662958ManoushKamenčići (COCI21_kamencici)C++14
0 / 70
1 ms300 KiB
#include <bits/stdc++.h> #define ll long long int #define F first #define S second #define pb push_back using namespace std; int main() { ll n,k; cin>>n>>k; string s; cin>>s; ll first=0; ll second=0; ll r=n-1; ll l=0; while (first!=k&&second!=k) { if (s[l]=='P') { l++; }else if (s[r]=='P') { r--; } else { l++; first++; } if (first==k)break; if (s[l]=='P') { l++; }else if (s[r]=='P') { r--; } else { l++; second++; } } if (first==k) cout<<"NE"<<endl; else cout<<"DA"<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...