Submission #723332

# Submission time Handle Problem Language Result Execution time Memory
723332 2023-04-13T15:44:53 Z stage Measures (CEOI22_measures) C++14
10 / 100
1500 ms 5324 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;

int32_t main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,d;
	cin >> n >> m >> d;
	vector<int> a(n);
	for (int i=0; i<n; ++i){
		cin >> a[i];
	}
	for (int k=0; k<m; ++k){
		int pos;
		cin >> pos;
		a.emplace_back(pos);
		sort(a.begin(),a.end());
		int maxi = 0;
		for (int i=0; i<n+k+1; ++i){
			for (int j=i+1; j<n+k+1; ++j){
				maxi = max(maxi,d*(j-i)-(a[j]-a[i]));
			}
		}
		cout << maxi/2;
		if (maxi&1) cout << ".5";
		cout << ' ';
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 23 ms 340 KB Output is correct
2 Correct 23 ms 340 KB Output is correct
3 Correct 22 ms 340 KB Output is correct
4 Correct 24 ms 340 KB Output is correct
5 Correct 21 ms 340 KB Output is correct
6 Correct 21 ms 360 KB Output is correct
7 Correct 24 ms 356 KB Output is correct
8 Correct 24 ms 356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 340 KB Output is correct
2 Correct 23 ms 340 KB Output is correct
3 Correct 22 ms 340 KB Output is correct
4 Correct 24 ms 340 KB Output is correct
5 Correct 21 ms 340 KB Output is correct
6 Correct 21 ms 360 KB Output is correct
7 Correct 24 ms 356 KB Output is correct
8 Correct 24 ms 356 KB Output is correct
9 Execution timed out 1567 ms 5324 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1543 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1543 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -