Submission #839545

#TimeUsernameProblemLanguageResultExecution timeMemory
839545model_codeChoreography (IOI23_choreography)C++17
24 / 100
71 ms6264 KiB
// correct/solution-subtask4.cpp #include "choreography.h" #include <vector> int x = 0, j = 0, n; bool s = false; std::vector<int> p, inv; void init(int N, std::vector<int> P){ n = N; p = P; inv.resize(N); for(int i = 0; i < N; i++){ inv[P[i]] = i; } } void move_right(int K) {} void move_left(int K) {} void swap_places() { x ^= 1; } void move_around(){ s = !s; std::swap(x, j); } int get_position(int D){ return s ? p[D^j]^x : inv[D^j]^x; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...