Submission #723340

# Submission time Handle Problem Language Result Execution time Memory
723340 2023-04-13T15:49:00 Z mimmocostes Measures (CEOI22_measures) C++14
0 / 100
1500 ms 2280 KB
#include <bits/stdc++.h>

using namespace std;

int N, M, D;
vector<long long> initial;
vector<long long> added;

string half (long long N) {
	if (N%2 == 0) {
		return to_string(N/2);
	} else {
		return to_string(N/2)+".5";
	}
}

int main () {
	cin >> N >> M >> D;

	initial.resize(N);
	added.resize(M);
	for (int i=0; i<N; i++) cin >> initial[i];
	for (int i=0; i<M; i++) cin >> added[i];

	//sort(added.begin(), added.end());

	for (int k=0; k<M; k++) {
		initial.push_back(added[k]);

		sort(initial.begin(), initial.end());

		long long M = 0;
		for (int i=0; i<N+k+1; i++) {
			for (int j=i+1; j<N+k+1; j++) {
				
				M = max(M, D*(j-i) - (initial[j]-initial[i]));
			}
		}
		cout << half(M) << endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 34 ms 340 KB Output is correct
2 Correct 30 ms 340 KB Output is correct
3 Correct 32 ms 340 KB Output is correct
4 Correct 30 ms 328 KB Output is correct
5 Correct 32 ms 340 KB Output is correct
6 Correct 33 ms 340 KB Output is correct
7 Correct 31 ms 340 KB Output is correct
8 Incorrect 30 ms 340 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 340 KB Output is correct
2 Correct 30 ms 340 KB Output is correct
3 Correct 32 ms 340 KB Output is correct
4 Correct 30 ms 328 KB Output is correct
5 Correct 32 ms 340 KB Output is correct
6 Correct 33 ms 340 KB Output is correct
7 Correct 31 ms 340 KB Output is correct
8 Incorrect 30 ms 340 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1532 ms 2280 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1532 ms 2280 KB Time limit exceeded
2 Halted 0 ms 0 KB -