結果
問題 | No.40 多項式の割り算 |
ユーザー |
|
提出日時 | 2017-08-13 09:51:59 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 427 bytes |
コンパイル時間 | 3,546 ms |
コンパイル使用メモリ | 68,224 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 02:31:35 |
合計ジャッジ時間 | 4,479 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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,macrostemplate get*():string = stdin.readLine() #.strip()letD = get().parseInt()A = get().split().map(parseInt)var ans = Afor i in countdown(D, 3):ans[i-2] += ans[i]if ans.len >= 3 and ans[2] != 0:echo 2echo ans[0..2].mapIt($it).join(" ")elif ans.len >= 2 and ans[1] != 0:echo 1echo ans[0..1].mapIt($it).join(" ")else:echo 0echo ans[0]