Submission #707975

# Submission time Handle Problem Language Result Execution time Memory
707975 2023-03-10T16:24:55 Z TAhmed33 Unija (COCI17_unija) C++
0 / 100
713 ms 65536 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
int arr[10000001] = {};
signed main () {
	int n;
	cin >> n;
	while (n--) {
		int x, y;
		cin >> x >> y;
		x /= 2;
		arr[x] = max(arr[x], y);
	}
	int ans = arr[10000000];
	for (int i = 9999999; i >= 1; i--) {
		arr[i] = max(arr[i], arr[i + 1]);
		ans += arr[i];
	}
	ans *= 2;
	cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Runtime error 48 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 53 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 52 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 53 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 681 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 47 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 62 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 124 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 224 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 713 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -