# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499429 | 2021-12-28T11:53:08 Z | Alisaf9 | Kamenčići (COCI21_kamencici) | C++14 | 0 ms | 204 KB |
#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 cout<<"NE"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Incorrect | 0 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Incorrect | 0 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Incorrect | 0 ms | 204 KB | Output isn't correct |