Submission #715042

#TimeUsernameProblemLanguageResultExecution timeMemory
715042EmmaKamenčići (COCI21_kamencici)C++11
0 / 70
1 ms212 KiB
#include<bits/stdc++.h>
using namespace std;

int main (){
	
	int n;
	int antun = 0;
	int counter = 0;
	int branka = 0;
	int k;
	cin>>n>>k;
	k = k*2-1;
	string pebbles;
	cin>>pebbles;
	
	while (antun<k&&branka<k){
		if(pebbles[counter]==80||pebbles[n-counter]==80){
		}
		// else if(pebbles[counter==80]&&pebbles[n-counter]==67){
// 			
		// }
		else {
		//if (pebbles[counter]=67||pebbles[n-counter]==67){
			if(counter%2==1){
				branka++;
			}
			else{
				antun++;
			}
	}
		counter++;
	}
	
	if(antun>branka){
		cout<<"NE";
	}
	else{
		cout<<"DA";
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...