結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2016-01-02 15:03:28 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 971 bytes |
コンパイル時間 | 900 ms |
コンパイル使用メモリ | 113,020 KB |
実行使用メモリ | 26,740 KB |
最終ジャッジ日時 | 2024-09-19 09:39:30 |
合計ジャッジ時間 | 2,814 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace yukicoder { class _040 { static void Main() { int d = int.Parse(Console.ReadLine()); int[] c = Array.ConvertAll(Console.ReadLine().Split(' ') , x => int.Parse(x)); for (int i = d; i >= 3; i--) { c[i - 2] += c[i]; } int od = 0; string b = ""; int m = Math.Min(2, c.Length - 1); for (int i = m; i >= 0; i--) { if (c[i] != 0) { if (od == 0) { od = i; } } if (od != 0) { b = c[i] + " " + b; } } if (od == 0) { b = "0"; } Console.WriteLine(od); Console.WriteLine(b); } } }