# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
224313 | 2020-04-17T16:46:11 Z | kshitij_sodani | Chameleon's Love (JOI20_chameleon) | C++17 | 5 ms | 512 KB |
#include <iostream> #include <bits/stdc++.h> using namespace std; #define a first #define b second #define pb push_back #include "chameleon.h" void Solve(int n){ int vis[2*n]; for(int i=0;i<2*n;i++){ vis[2*n]=0; } for(int i=0;i<2*n;i++){ if(vis[2*n]=0){ vector<int> aa; for(int j=0;j<2*n;j++){ if(i==j){ continue; } int x=Query({i+1,j+1}); if(x==1){ aa.pb(j+1); } } if(aa.size()==1){ vis[i]=1; vis[aa[0]-1]=1; Answer(i+1,aa[0]); } else{ vector<int> bb; for(int j=0;j<2*n;j++){ if(j!=i and j!=aa[0]-1){ bb.pb(j+1); } } int x=Query(bb); if(x==n){ vis[i]=1; vis[aa[1]-1]=1; Answer(i+1,aa[1]); } else{ vis[i]=1; vis[aa[0]-1]=1; Answer(i+1,aa[0]); } } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 512 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 512 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |