結果

問題 No.1476 esreveR dna esreveR
ユーザー phspls
提出日時 2022-10-05 23:27:29
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 12,561 ms
コンパイル使用メモリ 399,800 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 03:02:47
合計ジャッジ時間 11,514 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

const MOD: usize = 998244353;

fn power(base: usize, times: usize) -> usize {
    if times == 0 { return 1usize; }
    if times == 1 { return base; }
    let temp = power(base, times/2);
    temp * temp % MOD * power(base, times%2) % MOD
}

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();

    println!("{}", power(6, n/2));
}
0