結果

問題 No.2784 繰り上がりなし十進和
ユーザー Yukino DX.Yukino DX.
提出日時 2024-06-14 22:50:18
言語 Rust
(1.77.0)
結果
AC  
実行時間 893 ms / 2,000 ms
コード長 1,450 bytes
コンパイル時間 13,072 ms
コンパイル使用メモリ 379,956 KB
実行使用メモリ 136,172 KB
最終ジャッジ日時 2024-06-14 22:51:00
合計ジャッジ時間 27,506 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
5,248 KB
testcase_01 AC 119 ms
5,248 KB
testcase_02 AC 818 ms
136,072 KB
testcase_03 AC 126 ms
5,376 KB
testcase_04 AC 119 ms
5,376 KB
testcase_05 AC 120 ms
6,944 KB
testcase_06 AC 121 ms
6,944 KB
testcase_07 AC 118 ms
6,944 KB
testcase_08 AC 119 ms
6,940 KB
testcase_09 AC 129 ms
6,944 KB
testcase_10 AC 120 ms
6,940 KB
testcase_11 AC 118 ms
6,944 KB
testcase_12 AC 812 ms
136,172 KB
testcase_13 AC 807 ms
136,072 KB
testcase_14 AC 240 ms
35,488 KB
testcase_15 AC 157 ms
6,596 KB
testcase_16 AC 170 ms
11,272 KB
testcase_17 AC 453 ms
69,000 KB
testcase_18 AC 481 ms
69,004 KB
testcase_19 AC 223 ms
18,704 KB
testcase_20 AC 893 ms
136,068 KB
testcase_21 AC 190 ms
11,268 KB
testcase_22 AC 801 ms
136,008 KB
testcase_23 AC 154 ms
6,056 KB
testcase_24 AC 274 ms
20,744 KB
testcase_25 AC 438 ms
68,988 KB
testcase_26 AC 802 ms
136,012 KB
testcase_27 AC 782 ms
136,000 KB
testcase_28 AC 321 ms
35,484 KB
testcase_29 AC 794 ms
136,000 KB
testcase_30 AC 320 ms
35,460 KB
testcase_31 AC 174 ms
11,268 KB
testcase_32 AC 438 ms
69,000 KB
testcase_33 AC 477 ms
69,092 KB
testcase_34 AC 243 ms
20,740 KB
testcase_35 AC 155 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;

use proconio::{input, marker::Bytes};

fn main() {
    const W: usize = 6;
    input! {
        a:[Bytes;W],
    }
    let mut newa = vec![vec![0; W]; W];
    for i in 0..W {
        for j in 0..W {
            newa[i][j] = (a[i][j] - b'0') as usize;
        }
    }

    let mut b = vec![vec![vec![0; W]; 10]; W];
    for i in 0..W {
        let mut bi = newa[i].clone();
        for j in 0..10 {
            b[i][j] = bi.clone();

            for k in 0..W {
                bi[k] = (bi[k] + newa[i][k]) % 10;
            }
        }
    }

    let mut hs = HashSet::new();
    for i in 0..10 {
        for j in 0..10 {
            for k in 0..10 {
                for l in 0..10 {
                    for m in 0..10 {
                        for n in 0..10 {
                            let mut c = vec![0; W];
                            for o in 0..W {
                                c[o] = (b[0][i][o]
                                    + b[1][j][o]
                                    + b[2][k][o]
                                    + b[3][l][o]
                                    + b[4][m][o]
                                    + b[5][n][o])
                                    % 10;
                            }

                            hs.insert(c);
                        }
                    }
                }
            }
        }
    }

    let ans = hs.len();
    println!("{}", ans);
}
0