結果

問題 No.1476 esreveR dna esreveR
ユーザー tonyu0tonyu0
提出日時 2021-04-16 21:34:19
言語 Rust
(1.72.1)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 139,036 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 23:42:49
合計ジャッジ時間 1,569 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;

fn mod_pow(mut x: u64, mut e: u64, m: u64) -> u64 {
    let mut res = 1;
    while e > 0 {
        if e & 1 == 1 {
            res = res * x % m;
        }
        x = x * x % m;
        e >>= 1;
    }
    res
}

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: u64 = itr.next().unwrap().parse().unwrap();
    println!("{}", mod_pow(6, n / 2, 998244353));
}
0