제출 #516301

#제출 시각아이디문제언어결과실행 시간메모리
516301JomnoiArt Exhibition (JOI18_art)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> #define DEBUG 0 using namespace std; int main() { int n; cin >> n; vector <pair <long long, int>> vec; for(int i = 1; i <= n; i++) { long long a; int b; scanf(" %lld %d", &a, &b); vec.emplace_back(a, b); } sort(vec.begin(), vec.end()); long long ans = vec[0].second - vec[0].first, sum = vec[0].second; for(int i = 1; i < n; i++) { sum += vec[i].second; ans = max(ans, sum - vec[i].first + vec[0].first); } cout << ans; return 0; }

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

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