Submission #1000589

#TimeUsernameProblemLanguageResultExecution timeMemory
1000589AdamGSBulldozer (JOI17_bulldozer)C++17
5 / 100
0 ms604 KiB
#include<bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() const int LIM=2e3+7; pair<ll,ll>T[LIM]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; rep(i, n) cin >> T[i].st >> T[i].nd >> T[i].nd; sort(T, T+n); ll ans=0, sum=0, mi=0; rep(i, n) { sum+=T[i].nd; mi=min(mi, sum); ans=max(ans, sum-mi); } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...