제출 #699581

#제출 시각아이디문제언어결과실행 시간메모리
699581MohammadAbduljalilArt Exhibition (JOI18_art)C++17
50 / 100
1041 ms11208 KiB
#include <bits/stdc++.h> #define fast_input_output() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr) typedef long long ll; using namespace std; int main() { fast_input_output(); ll n, ans = LLONG_MIN; cin >> n; vector<pair<ll, ll>> v(n); for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second; sort(v.begin(), v.end()); for (int i = 0; i < n; i++) { ll s = v[i].second; ans = max(ans, s); for (int j = i + 1; j < n; j++) { s += v[j].second; ans = max(ans, s - (v[j].first - v[i].first)); if (s - (v[j].first - v[i].first) == 10) cout << i << ' ' << j << '\n'; } } cout << ans; 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...