Submission #789263

# Submission time Handle Problem Language Result Execution time Memory
789263 2023-07-21T08:43:36 Z Dan4Life Bulldozer (JOI17_bulldozer) C++17
0 / 100
1 ms 212 KB
#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

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 time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -