結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
|
| 提出日時 | 2014-10-01 01:46:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 595 ms |
| コンパイル使用メモリ | 58,964 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 06:52:16 |
| 合計ジャッジ時間 | 1,809 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
int main(){
int L,N,W[10000],t=0;
cin>>L>>N;
REP(i,N) cin>>W[i];
sort(W,W+N);
REP(i,N){
t += W[i];
if(t > L){ cout << i << endl; break; }
}
}