# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
208953 | AQT | JJOOII 2 (JOI20_ho_t2) | C++14 | 15 ms | 3844 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 N, K;
int lftmst[4][200005];
string s;
const string joi = "JOI";
int main(){
cin.sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N >> K >> s;
for(int i = 1; i<=N; i++){
lftmst[0][i] = i;
}
for(int t = 1; t<=3; t++){
int cnt = 0;
for(int l = 1, r = 1; r<=N; r++){
if(s[r-1] == joi[t-1]){
cnt++;
}
while(cnt > K){
cnt -= (s[l-1] == joi[t-1]);
l++;
}
while(cnt == K && l < r && s[l-1] != joi[t-1]){
l++;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |