結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
youjo_yamioti
|
| 提出日時 | 2018-11-30 09:55:47 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 378 bytes |
| 記録 | |
| コンパイル時間 | 7,117 ms |
| コンパイル使用メモリ | 54,272 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-13 21:46:16 |
| 合計ジャッジ時間 | 3,598 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 34 |
ソースコード
#include<cstdio>
#include<algorithm>
int main(){
int W[10000];
int L,N,i;
int max = 0;
int sum = 0;
scanf("%d %d",&L,&N);
for(i = 0; i < N; i++){
scanf("%d",&W[i]);
}
std::sort(W,W + N);
for(i=0;i<N;i++){
sum += W[i];
if(sum <= L){
max++;
}else break;
}
printf("%d/n",max);
return 0;
}
youjo_yamioti