Submission #271898

# Submission time Handle Problem Language Result Execution time Memory
271898 2020-08-18T07:56:49 Z MKutayBozkurt Art Exhibition (JOI18_art) C++14
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	vector<pair<long long, int>> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second;
	}
	sort(a.begin(), a.end());
	long long sum = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		sum += a[i].second;
		if (sum - (a[i].first - a[0].first) > ans) {
			ans = sum - (a[i].first - a[0].first);
		}
	}
	cout << ans << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -