Submission #134607

# Submission time Handle Problem Language Result Execution time Memory
134607 2019-07-23T05:31:27 Z 송준혁(#3242) Sushi (JOI16_sushi) C++14
15 / 100
106 ms 5556 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

int N, Q;
priority_queue<int> PQ;

int main(){
	scanf("%d %d", &N, &Q);
	for (int i=1; i<=N; i++) {
		int x;
		scanf("%d", &x);
		PQ.push(x);
	}
	while (Q--){
		int x;
		scanf("%*d %*d %d", &x);
		if (PQ.top() > x){
			printf("%d\n", PQ.top());
			PQ.pop(), PQ.push(x);
		}
		else printf("%d\n", x);
	}
	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:13:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &x);
   ~~~~~^~~~~~~~~~
sushi.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%*d %*d %d", &x);
   ~~~~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 106 ms 5108 KB Output is correct
2 Correct 88 ms 4244 KB Output is correct
3 Correct 55 ms 3180 KB Output is correct
4 Correct 106 ms 5348 KB Output is correct
5 Correct 87 ms 5444 KB Output is correct
6 Correct 93 ms 5348 KB Output is correct
7 Correct 92 ms 5556 KB Output is correct
8 Correct 91 ms 5348 KB Output is correct
9 Correct 51 ms 3308 KB Output is correct
10 Correct 78 ms 4328 KB Output is correct
11 Correct 50 ms 3316 KB Output is correct
12 Correct 80 ms 4332 KB Output is correct
13 Correct 106 ms 5076 KB Output is correct
14 Correct 88 ms 4352 KB Output is correct
15 Correct 55 ms 3180 KB Output is correct
16 Correct 106 ms 5476 KB Output is correct
17 Correct 88 ms 5512 KB Output is correct
18 Correct 92 ms 5352 KB Output is correct
19 Correct 92 ms 5420 KB Output is correct
20 Correct 90 ms 5508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -