Submission #1008935

#TimeUsernameProblemLanguageResultExecution timeMemory
1008935PenguinsAreCuteChameleon's Love (JOI20_chameleon)C++17
4 / 100
9 ms476 KiB
#include "chameleon.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 1; } // namespace void Solve(int N) { int pear[2*N]; fill(pear,pear+2*N,-1); for(int i=0;i<2*N;i++) if(pear[i]==-1) { int l = i+1, h = 2*N+1; while(h-l>1) { int m=(l+h)/2; vector<int> v(m-l); iota(v.begin(),v.end(),l+1); int orig = Query(v); v.push_back(i+1); if(Query(v)==orig) h=m; else l=m; } pear[i]=l; pear[l]=i; } for(int i=0;i<2*N;i++) if(pear[i]>i) Answer(i+1,1+pear[i]); }

Compilation message (stderr)

chameleon.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...