結果

問題 No.808 Kaiten Sushi?
ユーザー betrue12betrue12
提出日時 2019-03-22 22:20:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 2,259 ms
コンパイル使用メモリ 210,280 KB
実行使用メモリ 9,696 KB
最終ジャッジ日時 2023-10-19 09:39:52
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 5 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 3 ms
4,348 KB
testcase_14 AC 3 ms
4,348 KB
testcase_15 AC 4 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 36 ms
5,928 KB
testcase_24 AC 29 ms
4,760 KB
testcase_25 AC 33 ms
5,888 KB
testcase_26 AC 32 ms
5,856 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 48 ms
6,112 KB
testcase_34 AC 53 ms
6,236 KB
testcase_35 WA -
testcase_36 AC 49 ms
6,100 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 2 ms
4,348 KB
testcase_39 AC 86 ms
9,568 KB
testcase_40 AC 21 ms
4,624 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 33 ms
5,840 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 19 ms
4,568 KB
testcase_47 WA -
testcase_48 AC 95 ms
9,696 KB
testcase_49 AC 96 ms
9,696 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 70 ms
9,256 KB
testcase_53 AC 95 ms
9,676 KB
testcase_54 AC 2 ms
4,348 KB
testcase_55 AC 1 ms
4,348 KB
testcase_56 AC 2 ms
4,348 KB
testcase_57 AC 31 ms
5,868 KB
testcase_58 AC 54 ms
6,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    int64_t L, X[100000], Y[100000];
    cin >> N >> L;
    for(int i=0; i<N; i++) cin >> X[i];
    for(int i=0; i<N; i++) cin >> Y[i];

    vector<pair<int64_t, int>> order;
    for(int i=0; i<N; i++){
        order.push_back({X[i], -1});
        if(Y[i] < X[0]){
            order.push_back({Y[i]+L, 1});
        }else{
            order.push_back({Y[i], 1});
        }
    }
    sort(order.rbegin(), order.rend());

    int64_t now = 0, mx = 0, pos = 0;
    for(auto& p : order){
        now += p.second;
        if(now < 0) now++;
        if(now > mx){
            mx = now;
            pos = p.first;
        }
    }
    int64_t ans = (mx-1) * L + pos;
    cout << ans << endl;
    return 0;
}
0