結果

問題 No.2160 みたりのDominator
ユーザー hotman78hotman78
提出日時 2022-12-04 19:56:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,609 bytes
コンパイル時間 1,957 ms
コンパイル使用メモリ 203,316 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 02:55:18
合計ジャッジ時間 18,240 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 RE -
testcase_04 AC 52 ms
5,376 KB
testcase_05 AC 74 ms
5,376 KB
testcase_06 RE -
testcase_07 AC 27 ms
5,376 KB
testcase_08 AC 109 ms
5,376 KB
testcase_09 AC 125 ms
5,376 KB
testcase_10 AC 101 ms
5,376 KB
testcase_11 AC 133 ms
5,376 KB
testcase_12 AC 119 ms
5,376 KB
testcase_13 RE -
testcase_14 AC 98 ms
5,376 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 70 ms
5,376 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
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 RE -
testcase_66 RE -
testcase_67 RE -
testcase_68 RE -
testcase_69 RE -
testcase_70 RE -
testcase_71 RE -
testcase_72 RE -
testcase_73 RE -
testcase_74 RE -
testcase_75 RE -
testcase_76 RE -
testcase_77 RE -
testcase_78 RE -
testcase_79 RE -
testcase_80 RE -
testcase_81 RE -
testcase_82 RE -
testcase_83 RE -
61_evil_bias_nocross_01.txt RE -
61_evil_bias_nocross_02.txt RE -
61_evil_bias_nocross_03.txt RE -
61_evil_bias_nocross_04.txt RE -
61_evil_bias_nocross_05.txt RE -
61_evil_bias_nocross_06.txt RE -
61_evil_bias_nocross_07.txt RE -
61_evil_bias_nocross_08.txt RE -
61_evil_bias_nocross_09.txt RE -
61_evil_bias_nocross_10.txt RE -
61_evil_bias_nocross_11.txt RE -
61_evil_bias_nocross_12.txt RE -
権限があれば一括ダウンロードができます

ソースコード

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(min(1LL<<30,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