結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー nanophoto12nanophoto12
提出日時 2020-01-01 19:26:22
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,143 bytes
コンパイル時間 1,481 ms
コンパイル使用メモリ 121,024 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-14 17:27:17
合計ジャッジ時間 3,523 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}

0