結果

問題 No.2160 みたりのDominator
ユーザー hotman78hotman78
提出日時 2022-12-07 15:09:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,499 bytes
コンパイル時間 2,696 ms
コンパイル使用メモリ 198,680 KB
実行使用メモリ 17,792 KB
最終ジャッジ日時 2024-04-21 22:51:20
合計ジャッジ時間 14,687 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 8 ms
5,376 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 7 ms
5,376 KB
testcase_06 AC 8 ms
5,376 KB
testcase_07 AC 5 ms
5,376 KB
testcase_08 AC 7 ms
5,376 KB
testcase_09 AC 8 ms
5,376 KB
testcase_10 AC 7 ms
5,376 KB
testcase_11 AC 8 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 25 ms
5,376 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 9 ms
5,376 KB
testcase_16 AC 18 ms
5,376 KB
testcase_17 AC 6 ms
5,376 KB
testcase_18 AC 18 ms
5,376 KB
testcase_19 AC 22 ms
5,376 KB
testcase_20 AC 24 ms
5,376 KB
testcase_21 AC 11 ms
5,376 KB
testcase_22 AC 18 ms
5,376 KB
testcase_23 RE -
testcase_24 AC 8 ms
5,376 KB
testcase_25 AC 3 ms
5,376 KB
testcase_26 AC 4 ms
5,376 KB
testcase_27 AC 8 ms
5,376 KB
testcase_28 AC 13 ms
5,376 KB
testcase_29 AC 10 ms
5,376 KB
testcase_30 AC 6 ms
5,376 KB
testcase_31 AC 5 ms
5,376 KB
testcase_32 AC 12 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 8 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 3 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
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>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
using lint=long long;

int main(){
    array<lint,3>n;
    lint m;
    rep(i,3)cin>>n[i];
    cin>>m;
    vector<lint>s(m),t(m),a(m),b(m),u(m),v(m);
    lint n1=n[0],n2=n[0]+n[1],n3=n[0]+n[1]+n[2];
    assert(min(1LL<<30,lint(n[0]+1)*(n[1]+1)*(n[2]+1))*(m+1)<1e8);
    rep(i,m){
        cin>>u[i]>>v[i];
        u[i]--;v[i]--;
        if(u[i]>v[i])swap(u[i],v[i]);
        if(u[i]==n3){
            cout<<0<<endl;
            return 0;
        }
        if(u[i]<n1){
            a[i]=u[i]+1;
            s[i]=0;
        }else if(u[i]<n2){
            a[i]=u[i]-n1+1;
            s[i]=1;
        }else{
            a[i]=u[i]-n2+1;
            s[i]=2;
        }
        if(v[i]==n3){
            t[i]=s[i];
            b[i]=0;
        }else if(v[i]==n3+1){
            t[i]=s[i];
            b[i]=n[s[i]]+1;
        }else if(v[i]<n1){
            t[i]=0;
            b[i]=v[i]+1;
        }else if(v[i]<n2){
            t[i]=1;
            b[i]=v[i]-n1+1;
        }else{
            t[i]=2;
            b[i]=v[i]-n2+1;
        }
    }
    rep(i,3)n[i]++;
    //rep(i,m)cerr<<s[i]<<" "<<t[i]<<" "<<a[i]<<" "<<b[i]<<endl;
    lint ans=0;
    rep(p,n[0])rep(q,n[1])rep(r,n[2]){
        vector<lint>tmp={p,q,r};
        bool ok=1;
        rep(i,m){
            if((tmp[s[i]]<a[i])^(tmp[t[i]]<b[i])){
                ok=0;
                break;
            }
        }
        if(ok)ans++;
    }
    cout<<ans<<endl;
}
0