結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2018-01-30 18:02:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 397 bytes |
コンパイル時間 | 694 ms |
コンパイル使用メモリ | 68,640 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 21:40:56 |
合計ジャッジ時間 | 1,815 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 33 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<cstdio> #include<cmath> #include<string> using namespace std; int main(){ long long L,N,x,i; vector<long long> vc; cin >> L >> N; while(N--){ cin >> x; vc.push_back(x); } sort(vc.begin(),vc.end()); for(i=0;vc[i]<L;i++){ i++; L-=vc[i]; } cout << i; return 0; }