# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
871345 | 2023-11-10T15:36:24 Z | rainboy | Secret Permutation (RMI19_permutation) | C++17 | 13 ms | 600 KB |
#include "permutation.h" #include <vector> using namespace std; typedef vector<int> vi; const int N = 256; int abs_(int a) { return a > 0 ? a : -a; } int min(int a, int b) { return a < b ? a : b; } int dd[N]; void solve(int n) { vi ii(n); for (int i = 0; i < n; i++) { for (int h = 0; h < n; h++) ii[h] = (i + h) % n + 1; dd[i] = query(ii); } int sum = 0; for (int i = 0; i < n; i++) sum += dd[i]; sum /= (n - 1); for (int i = 0; i < n; i++) dd[i] = sum - dd[i]; vi pp(n); pp[0] = 0, pp[1] = dd[1]; for (int i = 2; i < n; i++) { for (int h = 0; h < n; h++) ii[h] = (h < i ? i - 1 - h : h) + 1; pp[i] = query(ii) - (sum - dd[0]) + dd[i]; if (abs_(pp[i] - pp[i - 1]) != dd[i]) pp[i] = -pp[i]; } int p = 0; for (int i = 0; i < n; i++) p = min(p, pp[i]); for (int i = 0; i < n; i++) pp[i] -= p - 1; answer(pp); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 344 KB | Partially correct |
2 | Partially correct | 0 ms | 344 KB | Partially correct |
3 | Partially correct | 0 ms | 420 KB | Partially correct |
4 | Partially correct | 0 ms | 344 KB | Partially correct |
5 | Partially correct | 0 ms | 344 KB | Partially correct |
6 | Partially correct | 0 ms | 344 KB | Partially correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 344 KB | Partially correct |
2 | Partially correct | 0 ms | 344 KB | Partially correct |
3 | Partially correct | 0 ms | 420 KB | Partially correct |
4 | Partially correct | 0 ms | 344 KB | Partially correct |
5 | Partially correct | 0 ms | 344 KB | Partially correct |
6 | Partially correct | 0 ms | 344 KB | Partially correct |
7 | Partially correct | 1 ms | 344 KB | Partially correct |
8 | Partially correct | 1 ms | 344 KB | Partially correct |
9 | Partially correct | 1 ms | 344 KB | Partially correct |
10 | Partially correct | 1 ms | 344 KB | Partially correct |
11 | Partially correct | 1 ms | 344 KB | Partially correct |
12 | Partially correct | 1 ms | 344 KB | Partially correct |
13 | Partially correct | 1 ms | 344 KB | Partially correct |
14 | Partially correct | 1 ms | 344 KB | Partially correct |
15 | Partially correct | 1 ms | 344 KB | Partially correct |
16 | Partially correct | 1 ms | 596 KB | Partially correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 344 KB | Partially correct |
2 | Partially correct | 0 ms | 344 KB | Partially correct |
3 | Partially correct | 0 ms | 420 KB | Partially correct |
4 | Partially correct | 0 ms | 344 KB | Partially correct |
5 | Partially correct | 0 ms | 344 KB | Partially correct |
6 | Partially correct | 0 ms | 344 KB | Partially correct |
7 | Partially correct | 1 ms | 344 KB | Partially correct |
8 | Partially correct | 1 ms | 344 KB | Partially correct |
9 | Partially correct | 1 ms | 344 KB | Partially correct |
10 | Partially correct | 1 ms | 344 KB | Partially correct |
11 | Partially correct | 1 ms | 344 KB | Partially correct |
12 | Partially correct | 1 ms | 344 KB | Partially correct |
13 | Partially correct | 1 ms | 344 KB | Partially correct |
14 | Partially correct | 1 ms | 344 KB | Partially correct |
15 | Partially correct | 1 ms | 344 KB | Partially correct |
16 | Partially correct | 1 ms | 596 KB | Partially correct |
17 | Partially correct | 10 ms | 424 KB | Partially correct |
18 | Partially correct | 11 ms | 420 KB | Partially correct |
19 | Partially correct | 10 ms | 428 KB | Partially correct |
20 | Partially correct | 11 ms | 420 KB | Partially correct |
21 | Partially correct | 10 ms | 428 KB | Partially correct |
22 | Partially correct | 10 ms | 424 KB | Partially correct |
23 | Partially correct | 12 ms | 428 KB | Partially correct |
24 | Partially correct | 13 ms | 600 KB | Partially correct |
25 | Partially correct | 11 ms | 424 KB | Partially correct |
26 | Partially correct | 11 ms | 412 KB | Partially correct |