結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー nanophoto12nanophoto12
提出日時 2020-01-01 19:36:49
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,295 bytes
コンパイル時間 1,159 ms
コンパイル使用メモリ 125,940 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-14 17:44:15
合計ジャッジ時間 2,785 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 3 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 4 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 4 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 5 ms
4,380 KB
testcase_27 WA -
testcase_28 AC 4 ms
4,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 4 ms
4,376 KB
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);
    vector<ll> cs(n);
    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;
    rep(i,n){
        ll sum1 = as[a+1] + bs[b];
        ll sum2 = as[a] + bs[b+1];
        if(sum1 >= sum2){
            a++;
        }
        else{
            b++;
        }
        cs[i] = max(sum1, sum2);
    }
    ll count = 0;
    int j = 0;
    sort(ds.begin(), ds.end(), std::greater<ll>());
    for(int i = 0;i < n;i++){
        if(ds[i] > cs[j]) continue;
        count++;
        j++;
    }
    cout << count << endl;
    return 0;
}

0