# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960899 | AlgorithmWarrior | JJOOII 2 (JOI20_ho_t2) | C++14 | 11 ms | 1408 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>
#define MAX 200005
using namespace std;
int vj[MAX],vo[MAX],vi[MAX];
int main()
{
int n,k;
cin>>n>>k;
int i;
for(i=1;i<=n;++i)
{
char ch;
cin>>ch;
if(ch=='J')
vj[++vj[0]]=i;
if(ch=='O')
vo[++vo[0]]=i;
if(ch=='I')
vi[++vi[0]]=i;
}
int pj,po=1,pi=1;
int ans=1e9;
for(pj=1;pj<=vj[0]-k+1;++pj)
{
while(po+k-1<=vo[0] && vo[po]<vj[pj+k-1])
++po;
if(po+k-1<=vo[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... |