結果
| 問題 |
No.793 うし数列 2
|
| コンテスト | |
| ユーザー |
nadeshino
|
| 提出日時 | 2019-02-23 08:56:18 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,098 bytes |
| コンパイル時間 | 3,023 ms |
| コンパイル使用メモリ | 70,784 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 19:27:24 |
| 合計ジャッジ時間 | 3,783 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 6 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 19) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated] /home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'algorithm' [UnusedImport] /home/judge/data/code/Main.nim(1, 19) Warning: imported and not used: 'future' [UnusedImport] /home/judge/data/code/Main.nim(1, 27) Warning: imported and not used: 'hashes' [UnusedImport]
ソースコード
import algorithm, future, hashes, macros, math, sequtils, sets, strutils, tables, unicode
template readString: string = stdin.readLine
template readStrings: seq[string] = stdin.readLine.split
template readInt: int = stdin.readLine.parseInt
template readInts: seq[int] = readLine(stdin).split(" ").map(parseInt)
template readFloat: float = stdin.readLine.parseFloat
template readFloats: seq[float] = stdin.readLine.split.map(parseFloat)
template times(n: int, body: untyped): untyped = (for _ in 0..<n: body)
proc newSeq2[T](n1, n2: Natural): seq[seq[T]] = newSeqWith(n1, newSeq[T](n2))
proc newSeq3[T](n1, n2, n3: Natural): seq[seq[seq[T]]] = newSeqWith(n1, newSeqWith(n2, newSeq[T](n3)))
macro unpack*(rhs: seq, cnt: static[int]): auto =
let t = genSym(); result = quote do:(let `t` = `rhs`;())
for i in 0..<cnt: result[0][1].add(quote do:`t`[`i`])
# -------------------------------------------------- #
const P = 10 ^ 9 + 7
var N = readInt
var res = 4
var a = 10
while N > 0:
if (N and 1) == 1:
res = res * a mod P
a = a * a mod P
N = N div 2
res -= 1
res = res div 3
echo res
nadeshino