Submission #563542

# Submission time Handle Problem Language Result Execution time Memory
563542 2022-05-17T12:15:17 Z zxcvbnm Lightning Conductor (POI11_pio) C++14
27 / 100
1000 ms 4204 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int& i : a) {
		cin >> i;
	}
	
	vector<int> ans(n, 0);
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++) {
			if (i == j) continue;
			ans[i] = max(ans[i], (int) ceil(sqrt(abs(i-j))) - a[i] + a[j]);
		}
	}
	
	for(int i : ans) {
		cout << i << "\n";
	} cout << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1084 ms 468 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 596 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1091 ms 720 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1084 ms 980 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1086 ms 2000 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1088 ms 3020 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 4204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1088 ms 4172 KB Time limit exceeded
2 Halted 0 ms 0 KB -