結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
HeyHey0111
|
| 提出日時 | 2016-02-17 21:18:34 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 360 bytes |
| 記録 | |
| コンパイル時間 | 450 ms |
| コンパイル使用メモリ | 82,532 KB |
| 実行使用メモリ | 9,748 KB |
| 最終ジャッジ日時 | 2026-09-02 07:29:47 |
| 合計ジャッジ時間 | 1,991 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> l(m);
for(int i=0;i< m ;i++){
cin >> l[i];
}
sort(l.begin(),l.end());
int sum=0,x=0;
while(1){
if(sum>n){
cout<<x-1<<endl;
return 0;
}
sum+=l[x];
x++;
}
cout<<x-1<<endl;
return 0;
}
HeyHey0111