제출 #82863

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
828632018-11-02 08:59:49chunghanArt Exhibition (JOI18_art)C++17
100 / 100
311 ms233700 KiB
#include<iostream>
#include<memory.h>
#include<utility>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long int lld;
lld n, s[500001] = {0, }, d[500001] = {0, }, a, b, tmp;
vector<pair<lld, lld>> art;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
art.push_back(pair<lld, lld>(0, 0));
for(int i = 0; i < n; i++) {
cin >> a >> b;
art.push_back(pair<lld, lld>(a, b));
}
d[0] = -9223372036854775808;
sort(art.begin(), art.end());
for(int i = 1; i <= n; i++) {
s[i] = s[i-1] + get<1>(art[i]);
d[i] = max(d[i-1], -s[i-1] + get<0>(art[i]));
}
lld tmp = 0;
for(int i = 1; i <= n; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

art.cpp:23:13: warning: integer constant is so large that it is unsigned
     d[0] = -9223372036854775808;
             ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...