結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 255 ms
104,308 KB
testcase_01 AC 433 ms
104,320 KB
testcase_02 AC 228 ms
100,096 KB
testcase_03 AC 942 ms
104,288 KB
testcase_04 AC 822 ms
104,224 KB
testcase_05 AC 827 ms
104,228 KB
testcase_06 AC 838 ms
104,284 KB
testcase_07 AC 781 ms
104,256 KB
testcase_08 AC 717 ms
104,124 KB
testcase_09 AC 615 ms
104,320 KB
testcase_10 AC 846 ms
104,228 KB
testcase_11 AC 820 ms
104,268 KB
testcase_12 AC 580 ms
104,208 KB
testcase_13 AC 648 ms
104,224 KB
testcase_14 AC 758 ms
104,260 KB
testcase_15 AC 740 ms
104,232 KB
testcase_16 AC 662 ms
104,244 KB
testcase_17 AC 712 ms
104,228 KB
testcase_18 AC 841 ms
104,228 KB
testcase_19 AC 804 ms
104,280 KB
testcase_20 AC 476 ms
104,320 KB
testcase_21 AC 626 ms
104,320 KB
testcase_22 AC 698 ms
104,272 KB
testcase_23 AC 676 ms
104,248 KB
testcase_24 AC 954 ms
104,192 KB
testcase_25 AC 686 ms
104,192 KB
testcase_26 AC 981 ms
104,192 KB
testcase_27 AC 719 ms
104,320 KB
testcase_28 AC 260 ms
104,320 KB
testcase_29 AC 306 ms
104,192 KB
testcase_30 AC 360 ms
104,320 KB
testcase_31 AC 395 ms
104,276 KB
testcase_32 AC 431 ms
104,312 KB
testcase_33 AC 464 ms
104,312 KB
testcase_34 AC 500 ms
104,320 KB
testcase_35 AC 539 ms
104,192 KB
testcase_36 AC 625 ms
104,240 KB
testcase_37 AC 770 ms
104,264 KB
testcase_38 AC 858 ms
104,320 KB
testcase_39 AC 982 ms
104,264 KB
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 AC 227 ms
100,212 KB
testcase_48 AC 999 ms
104,204 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around index expression
  --> main.rs:38:32
   |
38 | ...                   dp[(l^mt[j][x])][j|(1<<x)]+=dp[l][j]
   |                          ^          ^
   |
   = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
   |
38 -                             dp[(l^mt[j][x])][j|(1<<x)]+=dp[l][j]
38 +                             dp[l^mt[j][x]][j|(1<<x)]+=dp[l][j]
   |

warning: 1 warning emitted

ソースコード

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<usize> = {
            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 l in 0..2{
                if dp[l][j]!=0{
                    for k in 1..a.len(){
                        let x=a[k]-1;

                        if j & (1<<x)==0{
                            dp[(l^mt[j][x])][j|(1<<x)]+=dp[l][j]
                        }
                    }
                }
            }
        }
    }

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