제출 #366243

#제출 시각아이디문제언어결과실행 시간메모리
366243Tuk1352Art Exhibition (JOI18_art)C++11
0 / 100
0 ms364 KiB
#include <bits/stdc++.h> using namespace std; int main () { int n; cin >> n; long long A, S, MS=0, Su=0, Sd, I=0; vector <pair<long long, long long>> V; for (int i = 0; i < n; i++) { cin >> A >> S; V.push_back({A, S}); } sort(V.begin(), V.end()); for (int i = 0; i < V.size(); i++) { Su += V[i].second; Sd = Su - (V[i].first - V[I].first); while (Sd < 0) { Su -= V[I].second; I++; Sd = Su - (V[i].first - V[I].first); } MS = max(MS, Sd); } cout << MS; return 0; }

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

art.cpp: In function 'int main()':
art.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 0; i < V.size(); i++)
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...