제출 #1066970

#제출 시각아이디문제언어결과실행 시간메모리
1066970SzymonKrzywdaArt Exhibition (JOI18_art)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,a,b; cin >> n; vector<pair<int,int>> tab(0); for (int i=0; i<n; i++){ cin >> a >> b; tab.push_back({a,b}); } sort(tab.begin(),tab.end()); int wynik = 0; for (int i=0; i<n; i++){ int akt_wynik = 0; int pop = tab[i].first; for (int j=i; j<n; j++){ akt_wynik = akt_wynik-(tab[j].first-pop)+tab[j].second; pop = tab[j].first; wynik = max(wynik,akt_wynik); } } cout << wynik << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...