結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2016-12-28 18:39:24 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,359 bytes |
コンパイル時間 | 1,006 ms |
コンパイル使用メモリ | 110,912 KB |
実行使用メモリ | 29,312 KB |
最終ジャッジ日時 | 2024-12-15 07:57:20 |
合計ジャッジ時間 | 3,218 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 WA * 2 RE * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { int D = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); if (D == 0) { Console.WriteLine("0\n0"); } if (D < 3) { Console.WriteLine(D); for(int i = 0; i < D; i++) { Console.Write(a[i]+" "); } Console.Write(a[D] + "\n"); } for(int i = D; i >=3; i--) { a[i - 2] += a[i]; a[i] = 0; } bool aa = false; string ans = ""; int DD=0; int aaa = a[0]; int bbb = a[1]; int ccc = a[2]; if (ccc == 0) { if (bbb == 0) { Console.WriteLine(0); Console.WriteLine(aaa); } else { Console.WriteLine(1); Console.WriteLine("{0} {1}", aaa, bbb); } } else { Console.WriteLine(2); Console.WriteLine("{0} {1} {2}", aaa, bbb, ccc); } } }