Submission #789263

#TimeUsernameProblemLanguageResultExecution timeMemory
789263Dan4LifeBulldozer (JOI17_bulldozer)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(a) begin(a),end(a) vector<array<int,3>> v; int32_t main() { int n; cin >> n; int sum = 0, ans=0; for(int i = 0; i < n; i++){ int x,y,z; cin>>x>>y>>z; v.pb({x,y,z}); } sort(all(v)); for(auto [x,y,z] : v) sum+=z;ans=max(ans,sum), sum=max(sum,0ll); cout << ans; }

Compilation message (stderr)

bulldozer.cpp: In function 'int32_t main()':
bulldozer.cpp:15:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   15 |  for(auto [x,y,z] : v) sum+=z;ans=max(ans,sum), sum=max(sum,0ll);
      |  ^~~
bulldozer.cpp:15:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   15 |  for(auto [x,y,z] : v) sum+=z;ans=max(ans,sum), sum=max(sum,0ll);
      |                               ^~~
#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...