Submission #191474

# Submission time Handle Problem Language Result Execution time Memory
191474 2020-01-15T01:57:13 Z dndhk Sushi (JOI16_sushi) C++14
15 / 100
109 ms 8300 KB
#include <bits/stdc++.h>

#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAX_N = 400000;

int N, Q;
int arr[MAX_N+1];

priority_queue<int> pq1, pq2;

int main(){
	scanf("%d%d", &N, &Q);
	for(int i=1; i<=N; i++){
		scanf("%d", &arr[i]);
		pq1.push(arr[i]);
	}
	for(int i=1; i<=Q; i++){
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		pq1.push(c);
		printf("%d\n", pq1.top());
		pq1.pop();
	}

}

Compilation message

sushi.cpp: In function 'int main()':
sushi.cpp:19: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:21:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &arr[i]);
   ~~~~~^~~~~~~~~~~~~~~
sushi.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d", &a, &b, &c);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 109 ms 8156 KB Output is correct
2 Correct 93 ms 6756 KB Output is correct
3 Correct 57 ms 4656 KB Output is correct
4 Correct 109 ms 8216 KB Output is correct
5 Correct 89 ms 8292 KB Output is correct
6 Correct 96 ms 8204 KB Output is correct
7 Correct 96 ms 8164 KB Output is correct
8 Correct 94 ms 8272 KB Output is correct
9 Correct 54 ms 4800 KB Output is correct
10 Correct 82 ms 6748 KB Output is correct
11 Correct 55 ms 4724 KB Output is correct
12 Correct 82 ms 6888 KB Output is correct
13 Correct 105 ms 8280 KB Output is correct
14 Correct 92 ms 6856 KB Output is correct
15 Correct 57 ms 4708 KB Output is correct
16 Correct 109 ms 8292 KB Output is correct
17 Correct 93 ms 8164 KB Output is correct
18 Correct 96 ms 8164 KB Output is correct
19 Correct 98 ms 8300 KB Output is correct
20 Correct 93 ms 8184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 508 KB Output isn't correct
2 Halted 0 ms 0 KB -