# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
134606 | 2019-07-23T05:27:34 Z | 송준혁(#3242) | Sushi (JOI16_sushi) | C++14 | 11 ms | 504 KB |
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int, int> pii; int N, Q; int A[2020]; int main(){ scanf("%d %d", &N, &Q); for (int i=1; i<=N; i++) scanf("%d", &A[i]); while (Q--){ int S, T, D; scanf("%d %d %d", &S, &T, &D); for (int i=S; ; i++) { if (i > N) i = 1; if (D < A[i]) swap(A[i], D); if (i == T) break; } printf("%d\n", D); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 484 KB | Output is correct |
3 | Correct | 7 ms | 376 KB | Output is correct |
4 | Correct | 8 ms | 376 KB | Output is correct |
5 | Correct | 7 ms | 376 KB | Output is correct |
6 | Correct | 7 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 412 KB | Output is correct |
8 | Correct | 6 ms | 376 KB | Output is correct |
9 | Correct | 7 ms | 376 KB | Output is correct |
10 | Correct | 7 ms | 376 KB | Output is correct |
11 | Correct | 8 ms | 376 KB | Output is correct |
12 | Correct | 8 ms | 376 KB | Output is correct |
13 | Correct | 11 ms | 504 KB | Output is correct |
14 | Correct | 10 ms | 380 KB | Output is correct |
15 | Correct | 10 ms | 376 KB | Output is correct |
16 | Correct | 4 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 252 KB | Output is correct |
21 | Correct | 2 ms | 256 KB | Output is correct |
22 | Correct | 2 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3 ms | 504 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 484 KB | Output is correct |
3 | Correct | 7 ms | 376 KB | Output is correct |
4 | Correct | 8 ms | 376 KB | Output is correct |
5 | Correct | 7 ms | 376 KB | Output is correct |
6 | Correct | 7 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 412 KB | Output is correct |
8 | Correct | 6 ms | 376 KB | Output is correct |
9 | Correct | 7 ms | 376 KB | Output is correct |
10 | Correct | 7 ms | 376 KB | Output is correct |
11 | Correct | 8 ms | 376 KB | Output is correct |
12 | Correct | 8 ms | 376 KB | Output is correct |
13 | Correct | 11 ms | 504 KB | Output is correct |
14 | Correct | 10 ms | 380 KB | Output is correct |
15 | Correct | 10 ms | 376 KB | Output is correct |
16 | Correct | 4 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 252 KB | Output is correct |
21 | Correct | 2 ms | 256 KB | Output is correct |
22 | Correct | 2 ms | 376 KB | Output is correct |
23 | Execution timed out | 3 ms | 504 KB | Time limit exceeded (wall clock) |
24 | Halted | 0 ms | 0 KB | - |