Submission #596002

# Submission time Handle Problem Language Result Execution time Memory
596002 2022-07-14T09:07:37 Z 반딧불(#8442) Sushi (JOI16_sushi) C++17
15 / 100
430 ms 21176 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q;
int arr[400002];
int s[25002], t[25002], p[25002];
multiset<int> mst;

int main(){
    scanf("%d %d", &n, &q);
    for(int i=1; i<=n; i++){
        scanf("%d", &arr[i]);
        mst.insert(arr[i]);
    }
    for(int i=1; i<=q; i++) scanf("%d %d %d", &s[i], &t[i], &p[i]);
    for(int i=1; i<=q; i++){
        mst.insert(p[i]);
        printf("%d\n", *mst.rbegin());
        mst.erase(prev(mst.end()));
    }
}

Compilation message

sushi.cpp: In function 'int main()':
sushi.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
sushi.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf("%d", &arr[i]);
      |         ~~~~~^~~~~~~~~~~~~~~
sushi.cpp:18:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     for(int i=1; i<=q; i++) scanf("%d %d %d", &s[i], &t[i], &p[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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 345 ms 21160 KB Output is correct
2 Correct 380 ms 21064 KB Output is correct
3 Correct 120 ms 20876 KB Output is correct
4 Correct 430 ms 21176 KB Output is correct
5 Correct 176 ms 21128 KB Output is correct
6 Correct 137 ms 21148 KB Output is correct
7 Correct 129 ms 21068 KB Output is correct
8 Correct 167 ms 21112 KB Output is correct
9 Correct 138 ms 20976 KB Output is correct
10 Correct 147 ms 21056 KB Output is correct
11 Correct 150 ms 20948 KB Output is correct
12 Correct 181 ms 21100 KB Output is correct
13 Correct 357 ms 21176 KB Output is correct
14 Correct 359 ms 21096 KB Output is correct
15 Correct 130 ms 20964 KB Output is correct
16 Correct 396 ms 21172 KB Output is correct
17 Correct 172 ms 21064 KB Output is correct
18 Correct 161 ms 21136 KB Output is correct
19 Correct 166 ms 21176 KB Output is correct
20 Correct 172 ms 21108 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 -