제출 #1060819

#제출 시각아이디문제언어결과실행 시간메모리
1060819Hacv16휴가 (IOI14_holiday)C++17
47 / 100
5023 ms6368 KiB
#include "holiday.h" #include <bits/stdc++.h> using namespace std; #define int long long int const int MAX = 1e9 + 10; int findMaxAttraction(int32_t n, int32_t start, int32_t d, int32_t attraction[]) { int resp = 0; for(int l = 0; l <= start; l++) { int sum = 0; multiset<int> s; for(int r = l; r < n; r++) { s.insert(-attraction[r]); sum += attraction[r]; if(r >= start) { int fixedCost = min(start - 2 * l + r, 2 * r - start - l); int visits = d - fixedCost; while(s.size() > max(0LL, visits)) { int worst = *(--s.end()); s.erase(s.find(worst)); sum += worst; } resp = max(resp, sum); } } } return resp; } // int32_t main() // { // int n = 5, start = 2, d = 7; // int attraction[] = { 10, 2, 20, 30, 1 }; // cout << findMaxAttraction(n, start, d, attraction) << '\n'; // }

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

holiday.cpp: In function 'long long int findMaxAttraction(int32_t, int32_t, int32_t, int32_t*)':
holiday.cpp:28:32: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'const long long int' [-Wsign-compare]
   28 |                 while(s.size() > max(0LL, visits))
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...