제출 #330794

#제출 시각아이디문제언어결과실행 시간메모리
330794M_WArt Exhibition (JOI18_art)C++14
0 / 100
1 ms364 KiB
#include <bits/stdc++.h> using namespace std; #define ii pair<long long, long long> ii a[500500]; int main(){ int N; scanf("%d", &N); for(int i = 0; i < N; i++){ scanf("%lld %lld", &a[i].first, &a[i].second); } sort(a, a + N); long long curmax = a[0].second, maxmax = a[0].second; for(int i = 1; i < N; i++){ curmax += a[i].second - (a[i].first - a[i - 1].first); if(curmax < 0) curmax = a[i].second; maxmax = max(maxmax, curmax); } printf("%lld", maxmax); }

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

art.cpp: In function 'int main()':
art.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
art.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |   scanf("%lld %lld", &a[i].first, &a[i].second);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...