結果
| 問題 |
No.949 飲酒プログラミングコンテスト
|
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2020-01-01 19:26:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,143 bytes |
| コンパイル時間 | 1,056 ms |
| コンパイル使用メモリ | 119,304 KB |
| 最終ジャッジ日時 | 2025-01-08 15:18:02 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 1 WA * 28 |
ソースコード
#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <stack>
using namespace std;
typedef long long int ll;
typedef pair<char,char> pcc;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> t3;
#define rep(i,a) for(ll i = 0;i < a;i++)
template <class T>
void cmax(T& a, const T b){a=max(a,b);}
const ll mod = 1e9+7;
int main(void) {
ll n;
cin >> n;
vector<ll> as(n+1);
vector<ll> bs(n+1);
vector<ll> ds(n+1);
rep(i,n+1) cin >> as[i];
rep(i,n+1) cin >> bs[i];
rep(i,n) cin >> ds[i];
ll a = 0;
ll b = 0;
ll count = 0;
rep(i,n){
ll sum1 = as[a+1] + bs[b];
ll sum2 = as[a] + bs[b+1];
if(sum1 >= sum2){
a++;
}
else{
b++;
}
if(max(sum1, sum2) >= ds[i]) {
count++;
}
}
cout << count << endl;
return 0;
}
nanophoto12