結果
問題 | No.733 分身並列コーディング |
ユーザー |
![]() |
提出日時 | 2019-03-28 10:07:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 586 bytes |
コンパイル時間 | 773 ms |
コンパイル使用メモリ | 75,120 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 12:41:09 |
合計ジャッジ時間 | 2,210 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 34 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> int main() { int t,n; std::cin >> t >> n; int nn; std::vector<int> v; for (int i=0;i<n;i++) { std::cin >> nn; v.push_back(nn); } std::sort(v.begin(),v.end(),[](const int x, const int y){return x>y;}); std::vector<int> ans; for (auto c : v) { for (auto s : ans) { if (t>=c+s) { s+=c; c=0; break; } } if (c!=0) ans.push_back(c); } std::cout << ans.size() << std::endl; }