結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
東前頭十一枚目
|
| 提出日時 | 2018-08-03 20:19:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 5,000 ms |
| コード長 | 342 bytes |
| コンパイル時間 | 1,373 ms |
| コンパイル使用メモリ | 169,612 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 12:33:13 |
| 合計ジャッジ時間 | 2,272 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int INF=INT_MAX,MOD=1e9+7;
int main(){
int l,n; cin>>l>>n;
int w[n]; rep(i,n) cin>>w[i];
sort(w,w+n);
int sum=0,ans=0;
rep(i,n){
sum+=w[i];
if(l<sum) break;
ans++;
}
cout<<ans<<endl;
return 0;
}
東前頭十一枚目