# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
747683 | Sami_Massah | JJOOII 2 (JOI20_ho_t2) | C++17 | 6 ms | 1300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e3 + 12, mod = 1e9 + 7, inf = 1e9 + 12 ;
long long n, k, cnt[maxn];
vector<int> locs[3];
string s;
int main(){
cin >> n >> k;
cin >> s;
cnt[1] = (s[0] == 'O');
for(int i = 1; i < n; i++)
if(s[i] == 'O')
cnt[i] = cnt[i - 1] + 1;
else
cnt[i] = cnt[i - 1];
for(int i = 0; i < n; i++)
if(s[i] == 'J')
locs[0].push_back(i);
else if(s[i] == 'O')
locs[1].push_back(i);
else
locs[2].push_back(i);
long long ans = maxn;
for(int loc = 0; loc + k - 1 < locs[0].size(); loc++){
int ne = locs[0][loc + k - 1];
int l = -1, r = locs[2].size() - k + 1, mid;
while(r - l != 1){
int mid = (l + r) / 2;
컴파일 시 표준 에러 (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... |