# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1032476 | 2024-07-23T20:24:18 Z | aymanrs | Chameleon's Love (JOI20_chameleon) | C++14 | 1 ms | 348 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Wrong Answer [6] |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | 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 | - |
# | Verdict | Execution time | Memory | 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 | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Wrong Answer [6] |
4 | Halted | 0 ms | 0 KB | - |