結果
| 問題 |
No.40 多項式の割り算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-13 09:53:35 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 401 bytes |
| コンパイル時間 | 3,338 ms |
| コンパイル使用メモリ | 70,052 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 02:31:41 |
| 合計ジャッジ時間 | 4,422 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 50) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated] /home/judge/data/code/Main.nim(1, 50) Warning: imported and not used: 'future' [UnusedImport] /home/judge/data/code/Main.nim(1, 57) Warning: imported and not used: 'macros' [UnusedImport] /home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'strscans' [UnusedImport] /home/judge/data/code/Main.nim(1, 35) Warning: imported and not used: 'algorithm' [UnusedImport] /home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'math' [UnusedImport]
ソースコード
import sequtils,strutils,strscans,algorithm,math,future,macros
template get*():string = stdin.readLine() #.strip()
let
D = get().parseInt()
var
A = get().split().map(parseInt)
for i in countdown(D, 3):
A[i-2] += A[i]
if A.len >= 3 and A[2] != 0:
echo 2
echo A[0..2].mapIt($it).join(" ")
elif A.len >= 2 and A[1] != 0:
echo 1
echo A[0..1].mapIt($it).join(" ")
else:
echo 0
echo A[0]