답안 #1071733

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1071733 2024-08-23T10:37:24 Z vjudge1 Art Exhibition (JOI18_art) C++17
0 / 100
1 ms 348 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;
	int ans=0;
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		ans=max(ans,y);
		v.push_back({x,y});
	}
	sort(v.begin(),v.end());
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -