Submission #620145

#TimeUsernameProblemLanguageResultExecution timeMemory
620145mjhmjh1104Sushi (JOI16_sushi)C++17
15 / 100
82 ms6600 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...