| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 554343 | PLML | Pod starim krovovima (COCI20_psk) | C++14 | 1 ms | 304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
vector<int> a;
int n,i = 0,t,z,cnt = 0;cin >> n;
for(int i = 0;i<n;i++){
cin >> t >> z;
cnt += t;
a.push_back(z);
}
sort(a.begin(),a.end(),greater<int>());
while(cnt>0) cnt -= a[i++];
cout << n - i << endl;
for(int j = 0;j<i-1;j++) cout << a[j] << " ";
cout << cnt + a[i-1] << " ";
for(int j = i;j<n;j++) cout << 0 << " ";
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
