# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1031834 | 2024-07-23T07:53:53 Z | aymanrs | 카멜레온의 사랑 (JOI20_chameleon) | C++14 | 8 ms | 460 KB |
#include "chameleon.h" #include <bits/stdc++.h> using namespace std; void Solve(int N) { bool v[2*N+1] = {false}; int p = 1; vector<int> s = {1}; for(int i = 2;i <= 2*N;i++){ s.push_back(i); if(Query(s) > p){ p++; continue; } p--; int l = 0, r = s.size()-2, m, b = -1; while(l<r){ m = l+r>>1; swap(s[m+1], s.back()); if(Query(vector<int>(s.begin()+l, s.begin()+m+2)) == m-l+2) l = m+1; else r=m; swap(s[m+1], s.back()); } Answer(i, s[l]); s.pop_back(); s.erase(s.begin()+l); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 5 ms | 460 KB | Output is correct |
4 | Correct | 8 ms | 344 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Correct | 5 ms | 344 KB | Output is correct |
7 | Correct | 5 ms | 344 KB | Output is correct |
8 | Correct | 5 ms | 344 KB | Output is correct |
9 | Correct | 5 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 5 ms | 460 KB | Output is correct |
4 | Correct | 8 ms | 344 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Correct | 5 ms | 344 KB | Output is correct |
7 | Correct | 5 ms | 344 KB | Output is correct |
8 | Correct | 5 ms | 344 KB | Output is correct |
9 | Correct | 5 ms | 344 KB | Output is correct |
10 | Correct | 0 ms | 344 KB | Output is correct |
11 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
12 | Halted | 0 ms | 0 KB | - |