# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
207562 | super_j6 | JJOOII 2 (JOI20_ho_t2) | C++14 | 13 ms | 4988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
#include <vector>
using namespace std;
#define endl '\n'
#define pi pair<int, int>
const int maxn = 200000;
int n, k;
string s;
int a[maxn], dp[maxn][3];
vector<int> nx[3];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> k;
cin >> s;
int ret = n;
for(int i = 0; i < n; i++){
a[i] = s[i] == 'J' ? 0 : s[i] == 'O' ? 1 : 2;
nx[a[i]].push_back(i);
for(int j = 0; j < 3; j++){
int m = nx[j].size();
dp[i][j] = (m >= k ? j ? dp[nx[j][m - k]][j - 1] : nx[j][m - k] : -n);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |