답안 #134737

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
134737 2019-07-23T08:12:31 Z 임유진(#3241) Sushi (JOI16_sushi) C++14
5 / 100
49 ms 540 KB
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 2005;

int X[MAXN], S[MAXN], T[MAXN], P[MAXN];

int main() {
	ios::sync_with_stdio(false); cin.tie(0);

	int N, Q;

	cin >> N >> Q;
	for(int i = 1; i <= N; i++) cin >> X[i];
	for(int i = 0; i < Q; i++) cin >> S[i] >> T[i] >> P[i];

	for(int i = 0; i < Q; i++) {
		for(int j = S[i]; j != T[i]; j = j % N + 1) if(X[j] > P[i]) swap(X[j], P[i]);
		if(X[T[i]] > P[i]) swap(X[T[i]], P[i]);
		cout << P[i] << "\n";
		//for(int j = 1; j <= N; j++) printf("%d ", X[j]);
		//printf("\n");
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 376 KB Output is correct
2 Correct 25 ms 376 KB Output is correct
3 Correct 26 ms 376 KB Output is correct
4 Correct 25 ms 376 KB Output is correct
5 Correct 25 ms 376 KB Output is correct
6 Correct 26 ms 376 KB Output is correct
7 Correct 25 ms 376 KB Output is correct
8 Correct 25 ms 504 KB Output is correct
9 Correct 25 ms 376 KB Output is correct
10 Correct 26 ms 376 KB Output is correct
11 Correct 27 ms 376 KB Output is correct
12 Correct 26 ms 376 KB Output is correct
13 Correct 30 ms 376 KB Output is correct
14 Correct 49 ms 540 KB Output is correct
15 Correct 46 ms 376 KB Output is correct
16 Correct 3 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 348 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 376 KB Output is correct
2 Correct 25 ms 376 KB Output is correct
3 Correct 26 ms 376 KB Output is correct
4 Correct 25 ms 376 KB Output is correct
5 Correct 25 ms 376 KB Output is correct
6 Correct 26 ms 376 KB Output is correct
7 Correct 25 ms 376 KB Output is correct
8 Correct 25 ms 504 KB Output is correct
9 Correct 25 ms 376 KB Output is correct
10 Correct 26 ms 376 KB Output is correct
11 Correct 27 ms 376 KB Output is correct
12 Correct 26 ms 376 KB Output is correct
13 Correct 30 ms 376 KB Output is correct
14 Correct 49 ms 540 KB Output is correct
15 Correct 46 ms 376 KB Output is correct
16 Correct 3 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 348 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Halted 0 ms 0 KB -