답안 #268978

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
268978 2020-08-17T04:32:57 Z 반딧불(#5114) 카멜레온의 사랑 (JOI20_chameleon) C++17
4 / 100
70 ms 396 KB
#include <bits/stdc++.h>
#include "chameleon.h"

using namespace std;

int n;
bool chk[1002];

vector<int> range(int l, int r){
    vector<int> ret;
    for(int i=l; i<=r; i++) ret.push_back(i);
    return ret;
}

void Solve(int N){
    n = N;
    for(int i=1; i<=2*n; i++){
        if(chk[i]) continue;
        int l = i+1, r = 2*n, ans = 2*n;
        while(l<=r){
            int m = (l+r)>>1;
            int q1 = Query(range(i, m)), q2 = Query(range(i+1, m));
//            printf("%d %d - %d %d\n", i, m, q1, q2);
            if(q1==q2) ans = m, r = m-1;
            else l = m+1;
        }
        Answer(i, ans);
        chk[ans] = 1;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 55 ms 384 KB Output is correct
4 Correct 57 ms 384 KB Output is correct
5 Correct 70 ms 384 KB Output is correct
6 Correct 53 ms 384 KB Output is correct
7 Correct 58 ms 384 KB Output is correct
8 Correct 56 ms 384 KB Output is correct
9 Correct 57 ms 396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 55 ms 384 KB Output is correct
4 Correct 57 ms 384 KB Output is correct
5 Correct 70 ms 384 KB Output is correct
6 Correct 53 ms 384 KB Output is correct
7 Correct 58 ms 384 KB Output is correct
8 Correct 56 ms 384 KB Output is correct
9 Correct 57 ms 396 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Incorrect 1 ms 384 KB Wrong Answer [6]
12 Halted 0 ms 0 KB -