# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
286885 | arnold518 | JJOOII 2 (JOI20_ho_t2) | C++14 | 8 ms | 2688 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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2e5;
int N, K;
char S[MAXN+10];
int P[MAXN+10], Q[MAXN+10];
int main()
{
scanf("%d%d", &N, &K);
scanf("%s", S+1);
vector<int> V;
P[0]=-1;
for(int i=1; i<=N; i++)
{
if(S[i]=='J') V.push_back(i);
if(V.size()<K) P[i]=-1;
else P[i]=V[V.size()-K];
}
V.clear();
Q[N+1]=-1;
for(int i=N; i>=1; i--)
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... |