Submission #680123

#TimeUsernameProblemLanguageResultExecution timeMemory
680123ocarimaArt Exhibition (JOI18_art)C++14
30 / 100
1084 ms468 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i,a,b) for(lli i = (a); i <= (b); ++i) #define repa(i,a,b) for(lli i = (a); i >= (b); --i) #define nl "\n" #define MAX 500000 #define tam first #define belleza second lli n, res, s; pair<lli, lli> arbol[MAX + 2]; int main() { cin >> n; rep(i, 1, n) cin >> arbol[i].tam >> arbol[i].belleza; sort(arbol + 1, arbol + 1 + n); rep(ini, 1, n){ rep(fin, ini, n){ s = 0; rep(a, ini, fin) s += arbol[a].belleza; res = max(res, s - (arbol[fin].tam - arbol[ini].tam)); } } cout << res << nl; 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...