# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499431 | Alisaf9 | Kamenčići (COCI21_kamencici) | C++14 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |