Submission #1043955

# Submission time Handle Problem Language Result Execution time Memory
1043955 2024-08-05T05:11:19 Z ㅇㅇ(#11061) Measures (CEOI22_measures) C++17
24 / 100
1500 ms 6236 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...)
#endif
using ll=long long;
const int N=2e5+5;
int n,m;
ll d,a[N],b[N],c[2*N];
int main(){
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>n>>m>>d;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=m;i++) cin>>b[i];
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++) c[j]=a[j];
		for(int j=1;j<=i;j++) c[j+n]=b[j];
		sort(c+1,c+i+n+1);
		ll ans=0,mn=d-c[1];
		for(int j=2;j<=i+n;j++){
			ans=max(ans,j*d-c[j]-mn);
			mn=min(mn,j*d-c[j]);
		}
		if(ans%2==0) cout<<ans/2<<" ";
		else cout<<ans/2<<".5 ";
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 0 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2396 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 0 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2396 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 113 ms 6232 KB Output is correct
10 Correct 97 ms 6232 KB Output is correct
11 Correct 28 ms 6236 KB Output is correct
12 Correct 143 ms 6236 KB Output is correct
13 Correct 33 ms 6232 KB Output is correct
14 Correct 59 ms 6236 KB Output is correct
15 Correct 114 ms 6236 KB Output is correct
16 Correct 33 ms 6152 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1547 ms 2948 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1547 ms 2948 KB Time limit exceeded
2 Halted 0 ms 0 KB -