結果

問題 No.1476 esreveR dna esreveR
ユーザー yuruhiyayuruhiya
提出日時 2021-04-16 21:12:24
言語 Crystal
(1.11.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 22,332 ms
コンパイル使用メモリ 255,072 KB
実行使用メモリ 4,488 KB
最終ジャッジ日時 2023-09-15 23:01:14
合計ジャッジ時間 23,062 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

# require "template"
lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

# require "math/powmod"
struct Int
  def powmod(exp : self, mod : self)
    n = self % mod
    res = typeof(self).new(1)
    while exp > 0
      res = res * n % mod if exp.odd?
      n = n * n % mod
      exp >>= 1
    end
    res
  end
end

n = read_line.to_i64
puts 6i64.powmod(n // 2, 998244353)
0