Submission #1071729

# Submission time Handle Problem Language Result Execution time Memory
1071729 2024-08-23T10:35:29 Z vjudge1 Art Exhibition (JOI18_art) C++17
0 / 100
0 ms 600 KB
#include <bits/stdc++.h>
#define int long long
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
const int N=1e5+1;
const int inf=1e18;
const int mod=1e9+7;
using namespace std;
int n;
struct edge{
	int ans,mx,mn,sum;
};
vector<edge>v1;
vector<pair<int,int> >v;
signed main(){
	boost;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		v.push_back({x,y});
	}
	sort(v.begin(),v.end());
	int ans=0;
	for(int i=0;i<=0;i++){
		int sum=0;
		for(int j=i;j<n;j++){
			sum+=v[j].second;
			ans=max(ans,sum-(v[j].first-v[i].first));
		}
	}
	cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -