Submission #134606

# Submission time Handle Problem Language Result Execution time Memory
134606 2019-07-23T05:27:34 Z 송준혁(#3242) Sushi (JOI16_sushi) C++14
5 / 100
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

sushi.cpp: In function 'int main()':
sushi.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &N, &Q);
  ~~~~~^~~~~~~~~~~~~~~~~
sushi.cpp:11:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i=1; i<=N; i++) scanf("%d", &A[i]);
                           ~~~~~^~~~~~~~~~~~~
sushi.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d", &S, &T, &D);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Execution timed out 3 ms 504 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -