結果

問題 No.1715 Dinner 2
ユーザー hiikunZhiikunZ
提出日時 2021-10-28 17:29:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,030 bytes
コンパイル時間 2,331 ms
コンパイル使用メモリ 196,984 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 13:04:56
合計ジャッジ時間 3,616 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
constexpr ll MAX = 2000000000000000000;
constexpr ld PI = 3.14159265358979;
constexpr ll MOD = 0;//2024948111;
ld dotorad(ld K){return PI * K / 180.0;}
ld radtodo(ld K){return K * 180.0 / PI;}
mt19937 mt;
void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());}
int main(){
    ll N,D,ans = -MAX;
    cin >> N >> D;
    vector<ll> P(N),Q(N);
    for(ll i = 0;i < N;i++) cin >> P[i] >> Q[i];
    for(ll i = 0;i < N;i++) for(ll j = 0;j < N;j++) if(i != j){
        ll m = min(-P[i],Q[i] - P[i] - Q[j]);
        ll s = Q[i] + Q[j] - P[i] - P[j];
        if(s >= 0){
            ans = max(ans,m);
        }
        else{
            if(D % 2 == 0){
                ll p = s * (D / 2 - 1);
                ans = max(ans,p + m);
            }
            else{
                ll p = s * (D / 2);
                ans = max(ans,p - P[i]);
            }
        }
    }
    cout << ans << endl;
}
0