Submission #839547

#TimeUsernameProblemLanguageResultExecution timeMemory
839547model_codeChoreography (IOI23_choreography)C++17
7 / 100
83 ms5856 KiB
// correct/solution-subtask1.cpp #include "choreography.h" #include <vector> int n, s = 0; std::vector<int> p; void init(int N, std::vector<int> P){ n = N; p.resize(N); for(int i = 0; i < N; i++){ p[P[i]] = i; } } void move_right(int K){ s = (s + K + n) % n; } void move_left(int K){ move_right(-K); } void swap_places() {} void move_around() {} int get_position(int D){ return (p[D] + s) % n; }
#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...