제출 #152299

#제출 시각아이디문제언어결과실행 시간메모리
152299arnold518Sushi (JOI16_sushi)C++14
15 / 100
118 ms8356 KiB
#include <bits/stdc++.h>
using namespace std;

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

const int MAXN = 400000;
const int MAXQ = 25000;

int N, Q, A[MAXN+10], S, T, P;

int main()
{
    int i, j;

    scanf("%d%d", &N, &Q);

    priority_queue<int> PQ;
    for(i=1; i<=N; i++) scanf("%d", &A[i]), PQ.push(A[i]);

    while(Q--)
    {
        scanf("%d%d%d", &S, &T, &P);
        PQ.push(P);
        printf("%d\n", PQ.top()); PQ.pop();
    }
}

컴파일 시 표준 에러 (stderr) 메시지

sushi.cpp: In function 'int main()':
sushi.cpp:15:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
sushi.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &N, &Q);
     ~~~~~^~~~~~~~~~~~~~~~
sushi.cpp:20:43: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=1; i<=N; i++) scanf("%d", &A[i]), PQ.push(A[i]);
                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
sushi.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d", &S, &T, &P);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...