結果

問題 No.2152 [Cherry Anniversary 2] 19 Petals of Cherry
ユーザー titiatitia
提出日時 2022-12-09 02:36:03
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 1,189 bytes
コンパイル時間 923 ms
コンパイル使用メモリ 159,616 KB
実行使用メモリ 104,448 KB
最終ジャッジ日時 2024-04-22 18:59:15
合計ジャッジ時間 43,552 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 258 ms
104,320 KB
testcase_01 AC 489 ms
104,320 KB
testcase_02 AC 210 ms
100,328 KB
testcase_03 TLE -
testcase_04 AC 911 ms
104,128 KB
testcase_05 AC 875 ms
104,320 KB
testcase_06 AC 934 ms
104,264 KB
testcase_07 AC 856 ms
104,228 KB
testcase_08 AC 898 ms
104,312 KB
testcase_09 AC 711 ms
104,320 KB
testcase_10 AC 926 ms
104,332 KB
testcase_11 AC 905 ms
104,248 KB
testcase_12 AC 675 ms
104,216 KB
testcase_13 AC 727 ms
104,320 KB
testcase_14 AC 872 ms
104,256 KB
testcase_15 AC 927 ms
104,192 KB
testcase_16 AC 772 ms
104,332 KB
testcase_17 AC 827 ms
104,424 KB
testcase_18 AC 937 ms
104,320 KB
testcase_19 AC 915 ms
104,320 KB
testcase_20 AC 603 ms
104,332 KB
testcase_21 AC 803 ms
104,344 KB
testcase_22 AC 797 ms
104,248 KB
testcase_23 AC 759 ms
104,320 KB
testcase_24 TLE -
testcase_25 AC 803 ms
104,260 KB
testcase_26 TLE -
testcase_27 AC 790 ms
104,252 KB
testcase_28 AC 260 ms
104,356 KB
testcase_29 AC 309 ms
104,264 KB
testcase_30 AC 371 ms
104,208 KB
testcase_31 AC 416 ms
104,320 KB
testcase_32 AC 460 ms
104,256 KB
testcase_33 AC 510 ms
104,412 KB
testcase_34 AC 571 ms
104,256 KB
testcase_35 AC 651 ms
104,264 KB
testcase_36 AC 736 ms
104,228 KB
testcase_37 AC 823 ms
104,320 KB
testcase_38 AC 954 ms
104,320 KB
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 AC 207 ms
100,220 KB
testcase_48 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let max_length=524288;
    let mut mt=vec![vec![0;19];max_length];

    

    for i in 0..max_length{
        for x in 0..19{
            let mut t=0;
            for y in x+1..19{
                if i & (1<<y) !=0{
                    t+=1;
                }
            }
            mt[i][x]=t%2;
        }
    }

    let mut dp: Vec<Vec<i64>>=vec![vec![0;max_length];2];
    dp[0][0]=1;

    for _i in 0..19{
        let a: Vec<i64> = {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|x| x.parse().unwrap())
                .collect()
        };

        for jj in 0..max_length{
            let j=max_length-1-jj;

            for k in 0..a.len(){
                if k==0{
                    continue;
                }
                let x=a[k]-1;

                for l in 0..2{
                    if dp[l][j]!=0 && (j & (1<<x)==0){
                        dp[(l+mt[j][x as usize])%2][j|(1<<x)]+=dp[l][j]
                    }
                }
            }
        }
    }

    println!("{} {}",dp[0][max_length-1],dp[1][max_length-1]);
}


0