이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
ll n, m, k, A, B, C, T, s[2003], a, b, mx, ans;
priority_queue<ll> pq;
int main(void){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> m >> k; k -= m;
cin >> A >> B >> C >> T;
for(int i = 0; i < m; i++) cin >> s[i];
s[m] = n + 1;
for(int i = 0; i < m; i++){
if(T < 0) break;
mx = s[i + 1] - s[i];
a = min(T / A + 1, mx);
ans += a;
for(int x = 1; x <= k; x++){
if(T < a * C || a == mx) break;
b = min((T - a * C) / A + 1, mx - a);
pq.emplace(-b);
if(pq.size() > k) pq.pop();
a += b;
}
T -= B * (s[i + 1] - s[i]);
}
while(pq.size()){
ans += -pq.top(); pq.pop();
}
cout << ans - 1;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
semiexpress.cpp: In function 'int main()':
semiexpress.cpp:28:26: warning: comparison of integer expressions of different signedness: 'std::priority_queue<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
28 | if(pq.size() > k) pq.pop();
| ~~~~~~~~~~^~~| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |