#include "choreography.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
map<int, int> m;
vector<int> A;
void move_right(int K){
int N = A.size();
K = K%N;
vector<int> B(N);
int d = 0;
for(int i = 0; i < K; i++){
B[d] = A[i];
d++;
}
for(int i = K; i < N; i++){
B[d] = A[i];
d++;
}
for(int i = 0; i < N; i++){
A[i] = B[i];
m[A[i]] = i;
}
}
void move_left(int K){
int N = A.size();
K = K%N;
vector<int> B(N);
int d = 0;
for(int i = K; i < N; i++){
B[d] = A[i];
d++;
}
for(int i = 0; i < K; i++){
B[d] = A[i];
d++;
}
for(int i = 0; i < N; i++){
A[i] = B[i];
m[A[i]] = i;
}
}
void swap_places(){
int N = A.size();
for(int i = 0; i < N/2 - 1; i++){
swap(A[2*i], A[2*i + 1]);
}
for(int i = 0; i < N; i++){
m[A[i]] = i;
}
}
void move_around(){
int N = A.size();
vector<int> B(N);
for(int i = 0; i < N - 1; i++){
B[A[i]] = i;
}
for(int i = 0; i < N; i++){
A[i] = B[i];
}
}
int get_position(int D){
return m[D];
}
void init(int N, vector<int> P){
for(int i = 0; i < N; i++){
m[P[i]] = i;
}
A = P;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
11456 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
344 KB |
6th lines differ - on the 1st token, expected: '386', found: '57' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
10940 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
10940 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
11456 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
11456 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |