結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 RE -
testcase_02 AC 2 ms
6,940 KB
testcase_03 RE -
testcase_04 AC 61 ms
6,940 KB
testcase_05 AC 81 ms
6,940 KB
testcase_06 RE -
testcase_07 AC 29 ms
6,944 KB
testcase_08 AC 120 ms
6,940 KB
testcase_09 AC 136 ms
6,940 KB
testcase_10 AC 121 ms
6,940 KB
testcase_11 AC 144 ms
6,940 KB
testcase_12 AC 124 ms
6,940 KB
testcase_13 RE -
testcase_14 AC 113 ms
6,940 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 76 ms
6,944 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 2 ms
6,944 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 1 ms
6,944 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 TLE -
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(lint(n[0]+1)*(n[1]+1)*(n[2]+1)*(m+1)<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