Submission #1118160

#TimeUsernameProblemLanguageResultExecution timeMemory
1118160PanndaBulldozer (JOI17_bulldozer)C++17
0 / 100
1 ms500 KiB
//sub1 b瀛 1 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 2e3 + 3; array<int, 4> a[maxn]; int val[maxn]; void solve(){ int n; cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i][0] >> a[i][1] >> a[i][2]; a[i][3] = i; } sort(a + 1, a + n + 1); for(int i = 1; i <= n; i++) val[a[i][3]] = a[i][2]; int cur = 0, mn = 0, ans = 0; for(int i = 1; i <= n; i++){ cur += val[i]; ans = max(ans, cur - mn); mn = min(cur, mn); } cout << ans; } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); solve(); }
#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...