# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1032476 | aymanrs | Chameleon's Love (JOI20_chameleon) | C++14 | 1 ms | 348 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 "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
char samecol(int i, vector<int> g[], int j){
if(i==j) return 1;
for(int k : g[i]){
int r = samecol(k, g, j);
if(r) return -r;
}
return 0;
}
void Solve(int N) {
bool v[2*N+1] = {false};
int d[2*N+1] = {0};
vector<int> g[2*N+1];
auto adde = [&g](int a, int b) -> void {
g[a].push_back(b);
g[b].push_back(a);
};
for(int i = 1;i <= N;i++){
int l = N+1, r = 2*N, m;
while(l<r){
m = l+r>>1;
vector<int> s;for(int j = l;j <= m;j++) s.push_back(j);
int te = Query(s);
s.push_back(i);
if(Query(s) == te){
r = m;
} else l=m+1;
}
Answer(i,l);
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |