結果

問題 No.2671 NUPC Decompressor
ユーザー sakikuroesakikuroe
提出日時 2024-03-15 21:35:13
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,281 bytes
コンパイル時間 897 ms
コンパイル使用メモリ 186,372 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-03-15 21:35:17
合計ジャッジ時間 1,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,548 KB
testcase_01 AC 1 ms
6,548 KB
testcase_02 AC 1 ms
6,548 KB
testcase_03 AC 1 ms
6,548 KB
testcase_04 AC 1 ms
6,548 KB
testcase_05 AC 1 ms
6,548 KB
testcase_06 AC 1 ms
6,548 KB
testcase_07 AC 1 ms
6,548 KB
testcase_08 AC 1 ms
6,548 KB
testcase_09 AC 1 ms
6,548 KB
testcase_10 AC 1 ms
6,548 KB
testcase_11 AC 1 ms
6,548 KB
testcase_12 AC 1 ms
6,548 KB
testcase_13 AC 1 ms
6,548 KB
testcase_14 AC 1 ms
6,548 KB
testcase_15 AC 1 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let k;
    {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let mut ws = s.split_whitespace();
        k = ws.next().unwrap().parse::<usize>().unwrap();
    }

    let mut nupcs = Vec::new();

    {
        for i1 in 1..=2 {
            let mut s = Vec::new();
            s.push('N');
            if i1 == 2 {
                s.append(&mut s.clone());
            }
            for i2 in 1..=2 {
                let mut s = s.clone();
                s.push('U');
                if i2 == 2 {
                    s.append(&mut s.clone());
                }
                for i3 in 1..=2 {
                    let mut s = s.clone();
                    s.push('P');
                    if i3 == 2 {
                        s.append(&mut s.clone());
                    }
                    for i4 in 1..=2 {
                        let mut s = s.clone();
                        s.push('C');
                        if i4 == 2 {
                            s.append(&mut s.clone());
                        }
                        nupcs.push(s.clone().into_iter().collect::<String>());
                    }
                }
            }
        }
    }

    nupcs.sort();

    println!("{}", nupcs[k - 1]);
}
0