| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1344950 | jump | Stove (JOI18_stove) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
#define int long long
signed main(){
int n,k;
std::cin >> n >> k;
int fuel = n;
std::priority_queue<int> pq;
int last;
std::cin >> last;
for(int i=1;i<n;i++){
int in;
std::cin >> in;
if(last-in+1==0)k+=1;
pq.push(last-in+1);
}
while(n>k){
//std::cout << pq.top() << ' ';
fuel-=pq.top();pq.pop();
n--;
}
std::cout << fuel;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
