結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2014-10-01 01:49:50 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 516 ms |
| コンパイル使用メモリ | 91,356 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-03 22:40:36 |
| 合計ジャッジ時間 | 1,672 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
//これNo4かもわからない、とりあえず提出してみただけ
int main(){
int w[20000];
int n, l;
scanf("%d %d", &l, &n);
for(int i=0; i<n; i++)
scanf("%d", &w[i]);
sort(w, w + n);
int sum = 0, ans = 0;
for(; sum+w[ans]<=l; ans++)
sum += w[ans];
printf("%d\n", ans);
return 0;
}
184