結果
| 問題 |
No.2424 Josouzai
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-18 21:00:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 288 bytes |
| コンパイル時間 | 633 ms |
| コンパイル使用メモリ | 70,276 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 04:34:34 |
| 合計ジャッジ時間 | 4,051 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cassert>
using namespace std;
int N,K;
int A[2<<17];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N>>K;
for(int i=0;i<N;i++)cin>>A[i];
sort(A,A+N);
int c=0;
while(c<N&&A[c]<=K)K-=A[c++];
cout<<c<<" "<<K<<endl;
}