Submission #492857

#TimeUsernameProblemLanguageResultExecution timeMemory
492857watoKEArt Exhibition (JOI18_art)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std; int n,m,a,b,c,cnt,g,f,d,e,cvp,k; pair<int,int> dizi[100005]; int fark[100005]; string s; int main() { cin>>n; for (int i=0;i<n;i++) cin>>dizi[i].first>>dizi[i].second; sort(dizi,dizi+n); int mx=0; for (int i=0;i<n-1;i++) { int cvp=dizi[i].second; for (int j=i+1;j<n;j++) { cvp+=dizi[j].second; mx=max(mx,cvp-dizi[j].first+dizi[i].first); } } cout<<mx; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...