結果

問題 No.40 多項式の割り算
ユーザー しらゆきしらゆき
提出日時 2016-01-12 23:32:44
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 2,495 bytes
コンパイル時間 1,488 ms
コンパイル使用メモリ 110,736 KB
実行使用メモリ 26,568 KB
最終ジャッジ日時 2023-10-19 22:55:45
合計ジャッジ時間 3,757 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
25,448 KB
testcase_01 AC 30 ms
25,448 KB
testcase_02 AC 30 ms
25,448 KB
testcase_03 AC 30 ms
25,452 KB
testcase_04 AC 35 ms
26,404 KB
testcase_05 AC 36 ms
26,436 KB
testcase_06 AC 37 ms
26,552 KB
testcase_07 AC 37 ms
26,568 KB
testcase_08 AC 34 ms
25,780 KB
testcase_09 AC 35 ms
26,424 KB
testcase_10 AC 36 ms
26,548 KB
testcase_11 AC 35 ms
26,384 KB
testcase_12 AC 35 ms
26,308 KB
testcase_13 AC 38 ms
26,544 KB
testcase_14 AC 35 ms
26,408 KB
testcase_15 AC 35 ms
26,408 KB
testcase_16 AC 37 ms
26,548 KB
testcase_17 AC 35 ms
26,284 KB
testcase_18 AC 36 ms
26,472 KB
testcase_19 AC 36 ms
26,568 KB
testcase_20 AC 35 ms
26,376 KB
testcase_21 AC 34 ms
26,248 KB
testcase_22 AC 34 ms
26,240 KB
testcase_23 AC 35 ms
26,372 KB
testcase_24 AC 36 ms
26,436 KB
testcase_25 AC 29 ms
25,448 KB
testcase_26 AC 29 ms
25,452 KB
testcase_27 AC 30 ms
25,452 KB
testcase_28 RE -
testcase_29 AC 30 ms
25,448 KB
testcase_30 AC 29 ms
25,452 KB
testcase_31 AC 29 ms
25,452 KB
testcase_32 AC 30 ms
25,452 KB
testcase_33 AC 30 ms
25,452 KB
testcase_34 AC 30 ms
25,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var d = ri();
        var a = new int[100001];
        a = ria();

        for(int i = d; i >= 3; i--)
            a[i - 2] += a[i];

        if (a[2] == 0)
        {
            if (a[1] == 0)
            {
                Console.WriteLine(0);
                if (a[0] == 0)
                    Console.WriteLine(0);
                else
                    Console.WriteLine(a[0]);
            }
            else
            {
                Console.WriteLine(1);
                Console.WriteLine(a[0] + " " + a[1]);
            }
        }
        else
        {
            Console.WriteLine(2);
            Console.WriteLine(a[0] + " " + a[1] + " " + a[2]);
        }
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine().Trim()); }
    static long rl() { return long.Parse(Console.ReadLine().Trim()); }
    static double rd() { return double.Parse(Console.ReadLine().Trim()); }
    static string rs() { return Console.ReadLine().Trim(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    static void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    static void mul(out long a, out long b) { var arr = rla(); a = arr[0]; b = arr[1]; }
    static void mul(out long a, out long b, out long c) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out long a, out long b, out long c, out long d) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
    #region Math
    const int mod = 1000000007;
    static bool isprime(long n){ if (n < 2) return false; for (long i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
    static long gcd(long a, long b) { return a == 0 ? b : gcd(b % a, a); }
    static long lcm(long a, long b) { return a * b / gcd(a, b); }
    #endregion
}
0