結果
| 問題 |
No.1232 2^x = x
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-23 14:30:23 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 648 bytes |
| コンパイル時間 | 2,980 ms |
| コンパイル使用メモリ | 72,036 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-27 22:40:03 |
| 合計ジャッジ時間 | 3,600 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
コンパイルメッセージ
/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: 'deques' [UnusedImport] /home/judge/data/code/Main.nim(1, 27) Warning: imported and not used: 'heapqueue' [UnusedImport] /home/judge/data/code/Main.nim(1, 77) Warning: imported and not used: 'tables' [UnusedImport] /home/judge/data/code/Main.nim(1, 44) Warning: imported and not used: 'sets' [UnusedImport] /home/judge/data/code/Main.nim(1, 50) Warning: imported and not used: 'sequtils' [UnusedImport] /home/judge/data/code/Main.nim(1, 70) Warning: imported and not used: 'sugar' [UnusedImport]
ソースコード
import algorithm, deques, heapqueue, math, sets, sequtils, strutils, sugar, tables
proc input*(): string =
return stdin.readLine
proc chmax*[T: SomeNumber](num0: var T, num1: T) =
num0 = max(num0, num1)
proc chmin*[T: SomeNumber](num0: var T, num1: T) =
num0 = min(num0, num1)
proc `%=`*[T: SomeInteger](num0: var T, num1: T) =
num0 = num0 mod num1
var
ans: seq[int]
proc solve() =
let N = input().parseInt
var pi: int
for _ in 0..<N:
pi = input().parseInt
if pi == 2:
ans.add(2)
else:
ans.add((pi - 1)^2)
echo ans.join("\n")
when is_main_module:
solve()