結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-01-30 18:19:16 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 707 ms |
| コンパイル使用メモリ | 95,940 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 23:55:13 |
| 合計ジャッジ時間 | 1,996 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
using namespace std;
int main(){
long long L,N,x,i=0,ans=0;
vector<long long> vc;
cin >> L >> N;
while(N--){
cin >> x;
vc.push_back(x);
}
sort(vc.begin(),vc.end());
for(i=0;i<vc.size();i++){
L-=vc[i];
if(L<0) break;
ans++;
}
cout << ans;
return 0;
}
focus