Submission #620145

# Submission time Handle Problem Language Result Execution time Memory
620145 2022-08-03T01:55:32 Z mjhmjh1104 Sushi (JOI16_sushi) C++17
15 / 100
82 ms 6600 KB
#include <queue>
#include <cstdio>
using namespace std;

int n, m;
priority_queue<int> q;

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        q.push(x);
    }
    for (int i = 0; i < m; i++) {
        int l, r, p;
        scanf("%d%d%d", &l, &r, &p);
        q.push(p);
        printf("%d\n", q.top()); q.pop();
    }
}

Compilation message

sushi.cpp: In function 'int main()':
sushi.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d%d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~
sushi.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", &x);
      |         ~~~~~^~~~~~~~~~
sushi.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         scanf("%d%d%d", &l, &r, &p);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 82 ms 6492 KB Output is correct
2 Correct 61 ms 5060 KB Output is correct
3 Correct 42 ms 3136 KB Output is correct
4 Correct 64 ms 6520 KB Output is correct
5 Correct 73 ms 6596 KB Output is correct
6 Correct 73 ms 6500 KB Output is correct
7 Correct 69 ms 6548 KB Output is correct
8 Correct 71 ms 6544 KB Output is correct
9 Correct 44 ms 3152 KB Output is correct
10 Correct 60 ms 5028 KB Output is correct
11 Correct 40 ms 3136 KB Output is correct
12 Correct 61 ms 5140 KB Output is correct
13 Correct 65 ms 6460 KB Output is correct
14 Correct 61 ms 5132 KB Output is correct
15 Correct 42 ms 3152 KB Output is correct
16 Correct 65 ms 6508 KB Output is correct
17 Correct 70 ms 6600 KB Output is correct
18 Correct 72 ms 6596 KB Output is correct
19 Correct 72 ms 6512 KB Output is correct
20 Correct 70 ms 6588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -