結果

問題 No.40 多項式の割り算
ユーザー keymoonkeymoon
提出日時 2020-02-07 18:23:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 777 bytes
コンパイル時間 1,171 ms
コンパイル使用メモリ 110,324 KB
実行使用メモリ 26,320 KB
最終ジャッジ日時 2023-10-25 23:12:42
合計ジャッジ時間 3,402 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
25,532 KB
testcase_01 AC 34 ms
25,532 KB
testcase_02 AC 32 ms
25,408 KB
testcase_03 AC 34 ms
25,536 KB
testcase_04 AC 40 ms
26,140 KB
testcase_05 AC 40 ms
26,176 KB
testcase_06 AC 41 ms
26,300 KB
testcase_07 AC 42 ms
26,320 KB
testcase_08 AC 38 ms
25,884 KB
testcase_09 AC 41 ms
26,164 KB
testcase_10 AC 41 ms
26,296 KB
testcase_11 AC 42 ms
26,116 KB
testcase_12 AC 40 ms
26,032 KB
testcase_13 AC 41 ms
26,292 KB
testcase_14 AC 41 ms
26,144 KB
testcase_15 AC 41 ms
26,144 KB
testcase_16 AC 41 ms
26,296 KB
testcase_17 AC 39 ms
26,008 KB
testcase_18 AC 41 ms
26,216 KB
testcase_19 AC 41 ms
26,320 KB
testcase_20 AC 39 ms
26,108 KB
testcase_21 AC 39 ms
25,960 KB
testcase_22 AC 39 ms
25,952 KB
testcase_23 AC 40 ms
26,104 KB
testcase_24 AC 41 ms
26,176 KB
testcase_25 AC 34 ms
25,532 KB
testcase_26 AC 34 ms
25,536 KB
testcase_27 AC 34 ms
25,536 KB
testcase_28 AC 34 ms
25,460 KB
testcase_29 AC 35 ms
25,532 KB
testcase_30 AC 34 ms
25,536 KB
testcase_31 AC 34 ms
25,536 KB
testcase_32 AC 35 ms
25,536 KB
testcase_33 AC 35 ms
25,536 KB
testcase_34 AC 37 ms
25,536 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.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        int d = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        for (int i = a.Length - 1; i >= 3; i--)
        {
            a[i - 2] += a[i];
            a[i] = 0;
        }
        var res = a.Reverse().SkipWhile(x => x == 0).Reverse().ToArray();
        Console.WriteLine(Max(res.Length - 1, 0));
        Console.WriteLine(res.Length == 0 ? "0" : string.Join(" ", res));
    }
}
0