結果

問題 No.2160 みたりのDominator
ユーザー hotman78hotman78
提出日時 2022-12-07 12:39:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,470 bytes
コンパイル時間 2,347 ms
コンパイル使用メモリ 199,168 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-21 21:19:44
合計ジャッジ時間 8,271 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 9 ms
5,376 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 6 ms
5,376 KB
testcase_06 AC 7 ms
5,376 KB
testcase_07 AC 5 ms
5,376 KB
testcase_08 AC 7 ms
5,376 KB
testcase_09 AC 7 ms
5,376 KB
testcase_10 AC 6 ms
5,376 KB
testcase_11 AC 6 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 24 ms
5,376 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 9 ms
5,376 KB
testcase_16 AC 19 ms
5,376 KB
testcase_17 AC 5 ms
5,376 KB
testcase_18 AC 17 ms
5,376 KB
testcase_19 AC 23 ms
5,376 KB
testcase_20 AC 25 ms
5,376 KB
testcase_21 AC 11 ms
5,376 KB
testcase_22 AC 18 ms
5,376 KB
testcase_23 AC 7 ms
5,376 KB
testcase_24 AC 7 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 4 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 13 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 6 ms
5,376 KB
testcase_31 AC 5 ms
5,376 KB
testcase_32 AC 11 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 8 ms
5,376 KB
testcase_35 AC 2 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 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>
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(lint(n[0]+1)*(n[1]+1)*(n[2]+1)*(m+1)<1e9);
    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]=n[s[i]]+2;
        }else if(v[i]==n3+1){
            t[i]=s[i];
            b[i]=0;
        }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