結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2019-10-20 15:49:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 227 bytes |
コンパイル時間 | 527 ms |
コンパイル使用メモリ | 59,948 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-02 17:27:17 |
合計ジャッジ時間 | 1,535 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 24 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int L,N,W[100000],i; int main(){ cin>>L>>N; for(i=0;i<N;i++)cin>>W[i]; sort(W,W+N); for(i=0;i<N&&L>=0;i++)L-=W[i]; cout<<i<<endl; return 0; }