제출 #1111988

#제출 시각아이디문제언어결과실행 시간메모리
1111988vjudge1Art Exhibition (JOI18_art)C++14
100 / 100
404 ms19664 KiB
#include <bits/stdc++.h> using namespace std; pair<long long,long long> a[500010]; int main() { int n; cin >> n; for(int i=0;i<n;i++){ cin >> a[i].first >> a[i].second; } sort(a,a+n); long long maxn=INT_MIN,fm=INT_MAX,qs=0; for(int i=0;i<n;i++){ auto [x,y]=a[i]; fm=min(fm,qs-x); qs+=y; maxn=max(maxn,qs-x-fm); } cout << maxn; return 0; }

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

art.cpp: In function 'int main()':
art.cpp:15:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   15 |         auto [x,y]=a[i];
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...