結果
| 問題 |
No.949 飲酒プログラミングコンテスト
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-12 00:08:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 781 bytes |
| コンパイル時間 | 1,262 ms |
| コンパイル使用メモリ | 94,636 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-24 08:08:14 |
| 合計ジャッジ時間 | 2,310 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 WA * 19 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
typedef long long int ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n,x; cin >> n;
queue<int> ken,koo;
for(int i=0;i<n+1;i++){
cin >> x;
ken.push(x);
}
for(int i=0;i<n+1;i++){
cin >> x;
koo.push(x);
}
vector<int> d(n);
for(int i=0;i<n;i++){
cin >> d[i];
}
sort(d.begin(),d.end());
int ans=0;
while(d.size()){
int k=d.back();
d.pop_back();
queue<int> cp,cp2;
cp=ken;
cp2=koo;
cp.pop(); cp2.pop();
if(max(cp.front()+koo.front(),ken.front()+cp2.front())<k)continue;
if(cp.front()+koo.front()>=ken.front()+cp2.front()){
ans++;
ken.pop();
}
else{
ans++;
koo.pop();
}
}
cout << ans << endl;
}