結果
問題 | No.1476 esreveR dna esreveR |
ユーザー |
![]() |
提出日時 | 2021-04-16 21:12:24 |
言語 | Crystal (1.14.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 15,119 ms |
コンパイル使用メモリ | 295,128 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-03 00:19:35 |
合計ジャッジ時間 | 16,097 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
# require "template"lib Cfun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64endclass Stringdef to_i64C.strtoll(self, nil, 10)endend# require "math/powmod"struct Intdef powmod(exp : self, mod : self)n = self % modres = typeof(self).new(1)while exp > 0res = res * n % mod if exp.odd?n = n * n % modexp >>= 1endresendendn = read_line.to_i64puts 6i64.powmod(n // 2, 998244353)