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 <iostream>
#include <string>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
int cnt = 0; // count of consecutive red pebbles
for (int i = 0; i < n; i++) {
if (s[i] == 'C') {
cnt++;
if (cnt >= k) {
cout << "DA" << endl;
return 0;
}
} else {
cnt = 0;
}
}
cout << "NE" << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |