結果

問題 No.2640 traO Stamps
ユーザー noya2noya2
提出日時 2024-02-18 23:17:48
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,828 bytes
コンパイル時間 11,954 ms
コンパイル使用メモリ 361,604 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-18 23:18:03
合計ジャッジ時間 13,567 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
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 WA -
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 -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
#include"testlib.h"
using namespace std;
using ll = long long;

const ll Nmin = 2, Nmax = 200;
const ll Kmin = 1, Kmax = 200'000;
const ll Cmin = 0, Cmax = 1'000'000'000;
const ll Qmin = 1, Qmax = 100'000;
const ll Tmin = 1, Tmax = 2;

int main(){
    registerValidation();
    ll n = inf.readLong(Nmin,Nmax);
    inf.readSpace();
    const ll Mmax = n*(n-1)/2;
    ll m = inf.readLong(1LL,Mmax);
    inf.readSpace();
    ll k = inf.readLong(Kmin,Kmax);
    inf.readEoln();
    for (ll i = 0; i <= k; i++){
        if (i != 0){
            inf.readSpace();
        }
        inf.readLong(1LL,n);
    }
    inf.readEoln();
    set<pair<ll,ll>> st;
    atcoder::dsu d(n);
    for (ll i = 0; i < m; i++){
        ll a = inf.readLong(1LL,n);
        inf.readSpace();
        ll b = inf.readLong(1LL,n);
        inf.readSpace();
        inf.readLong(Cmin,Cmax);
        inf.readEoln();
        ensuref(a < b, "A[i] < B[i]");
        st.insert(pair<ll,ll>(a,b));
        a--, b--;
        d.merge(a,b);
    }
    ensuref((ll)(st.size()) == m, "(A[i],B[i]) are must be distinct");
    ensuref((ll)(d.size(0)) == n, "graph must be connected");
    ll q = inf.readLong(Qmin,Qmax);
    inf.readEoln();
    bool t2_done = false;
    for (ll i = 0; i < q; i++){
        ll t = inf.readLong(Tmin,Tmax);
        inf.readSpace();
        if (t == 1){
            ll x = inf.readLong(0LL,k);
            inf.readSpace();
            ll y = inf.readLong(1LL,n);
            inf.readEoln();
        }
        else {
            t2_done = true;
            ll x = inf.readLong(0LL,k);
            inf.readSpace();
            ll y = inf.readLong(0LL,k);
            inf.readEoln();
            ensuref(x <= y, "x <= y");
        }
    }
    ensuref(t2_done, "T = 2 did not come");
    inf.readEof();
}
0