結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
piniky
|
| 提出日時 | 2015-09-02 14:53:09 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 78,108 KB |
| 実行使用メモリ | 86,076 KB |
| 最終ジャッジ日時 | 2026-04-02 11:48:55 |
| 合計ジャッジ時間 | 2,506 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 14 |
ソースコード
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main(){
int L, N, nowL = 0, W[10001];
cin >> L >> N;
for (int i = 0; i < N; i++) cin >> W[i];
sort(W, W+N);
for (int i = 0; i < N; i++){
if (nowL < L){
nowL += W[i];
}
else{
cout << i - 1 << endl;
return 0;
}
}
cout << N - 1<< endl;
return 0;
}
piniky