結果

問題 No.2160 みたりのDominator
ユーザー hotman78hotman78
提出日時 2022-12-04 19:53:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,588 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 202,308 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-20 02:52:20
合計ジャッジ時間 6,272 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,756 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
61_evil_bias_nocross_01.txt -- -
61_evil_bias_nocross_02.txt -- -
61_evil_bias_nocross_03.txt -- -
61_evil_bias_nocross_04.txt -- -
61_evil_bias_nocross_05.txt -- -
61_evil_bias_nocross_06.txt -- -
61_evil_bias_nocross_07.txt -- -
61_evil_bias_nocross_08.txt -- -
61_evil_bias_nocross_09.txt -- -
61_evil_bias_nocross_10.txt -- -
61_evil_bias_nocross_11.txt -- -
61_evil_bias_nocross_12.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/scc>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<int(n);++i)
using lint=long long;

int main(){
    array<int,3>n;
    array<int,4>n2;
    int m,ns=0;
    rep(i,3)cin>>n[i];
    rep(i,3)ns+=n[i];
    n2[0]=0;
    rep(i,3)n2[i+1]=n2[i]+n[i];
    cin>>m;
    vector<int>u(m),v(m),st;
    rep(i,m){
        cin>>u[i]>>v[i];
        u[i]--;v[i]--;
    }
    lint ans=0;
    assert((n[0]+1)*(n[1]+1)*(n[2]+1)*m<10000000);
    rep(p,n[0]+1)rep(q,n[1]+1)rep(r,n[2]+1){
        array<int,3>sel={p,q,r};
        bool ok=1;
        rep(i,m){
            if(u[i]>v[i])swap(u[i],v[i]);
            if(u[i]==ns){
                cout<<0<<endl;
                return 0;
            }
            if(v[i]==ns){
                rep(s,3){
                    if(n2[s]<=u[i]&&u[i]<n2[s+1]){
                        if(u[i]<=(n2[s]+sel[s])){
                            ok=0;
                        }
                    }
                }
            }else if(v[i]==ns+1){
                rep(s,3){
                    if(n2[s]<=u[i]&&u[i]<n2[s+1]){
                        if(u[i]>(n2[s]+sel[s])){
                            ok=0;
                        }
                    }
                }
            }
            rep(s,3)rep(t,3){
                if(n2[s]<=u[i]&&u[i]<n2[s+1]&&n2[t]<=v[i]&&v[i]<n2[t+1]){
                    if((u[i]<(n2[s]+sel[s]))^(v[i]<(n2[t]+sel[t]))){
                        ok=0;
                    }
                }
            }
        }
        if(ok)ans++;
    }
    cout<<ans<<endl;
}
0