Submission #108478

# Submission time Handle Problem Language Result Execution time Memory
108478 2019-04-30T04:36:29 Z E869120 Bulldozer (JOI17_bulldozer) C++14
5 / 100
3 ms 428 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

long long N, X[109], Y[109], W[109], maxn = 0;
vector<long long>A;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> X[i] >> Y[i] >> W[i];
		A.push_back(X[i]);
	}
	sort(A.begin(), A.end());
	A.erase(unique(A.begin(), A.end()), A.end());

	for (int i = 0; i < A.size(); i++) {
		for (int j = i; j < A.size(); j++) {
			long long sum = 0;
			for (int k = 0; k < N; k++) {
				if (A[i] <= X[k] && X[k] <= A[j]) sum += W[k];
			}
			maxn = max(maxn, sum);
		}
	}
	cout << maxn << endl;
	return 0;
}

Compilation message

bulldozer.cpp: In function 'int main()':
bulldozer.cpp:18:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < A.size(); i++) {
                  ~~^~~~~~~~~~
bulldozer.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = i; j < A.size(); j++) {
                   ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 3 ms 256 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 3 ms 428 KB Output is correct
7 Correct 3 ms 256 KB Output is correct
8 Correct 3 ms 384 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 384 KB Output is correct
14 Correct 2 ms 356 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 3 ms 256 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 3 ms 428 KB Output is correct
7 Correct 3 ms 256 KB Output is correct
8 Correct 3 ms 384 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 384 KB Output is correct
14 Correct 2 ms 356 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Incorrect 3 ms 356 KB Output isn't correct
17 Halted 0 ms 0 KB -