結果
| 問題 |
No.5 数字のブロック
|
| コンテスト | |
| ユーザー |
re1ns
|
| 提出日時 | 2015-11-06 22:46:41 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 343 bytes |
| コンパイル時間 | 612 ms |
| コンパイル使用メモリ | 63,984 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 13:24:01 |
| 合計ジャッジ時間 | 1,673 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int l,n;
cin >> l >> n;
int w[n];
for(int i=0;i<n;i++)cin >> w[i];
sort(w,w+n);
for(int i=0,sum=0;i<n;i++){
sum+=w[i];
if(sum>l){
cout << i << endl;
break;
}
}
}
re1ns