結果

問題 No.40 多項式の割り算
ユーザー GrenacheGrenache
提出日時 2015-11-03 16:50:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 245 ms / 5,000 ms
コード長 787 bytes
コンパイル時間 3,343 ms
コンパイル使用メモリ 72,344 KB
実行使用メモリ 60,112 KB
最終ジャッジ日時 2023-10-11 13:25:58
合計ジャッジ時間 11,286 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,964 KB
testcase_01 AC 126 ms
56,100 KB
testcase_02 AC 124 ms
55,844 KB
testcase_03 AC 125 ms
56,044 KB
testcase_04 AC 223 ms
59,860 KB
testcase_05 AC 228 ms
58,912 KB
testcase_06 AC 245 ms
59,532 KB
testcase_07 AC 244 ms
59,988 KB
testcase_08 AC 151 ms
56,292 KB
testcase_09 AC 225 ms
59,220 KB
testcase_10 AC 243 ms
59,360 KB
testcase_11 AC 210 ms
59,076 KB
testcase_12 AC 203 ms
58,660 KB
testcase_13 AC 237 ms
59,740 KB
testcase_14 AC 210 ms
59,200 KB
testcase_15 AC 211 ms
59,308 KB
testcase_16 AC 243 ms
60,112 KB
testcase_17 AC 192 ms
58,204 KB
testcase_18 AC 239 ms
59,468 KB
testcase_19 AC 244 ms
59,344 KB
testcase_20 AC 214 ms
59,220 KB
testcase_21 AC 198 ms
58,172 KB
testcase_22 AC 193 ms
58,624 KB
testcase_23 AC 213 ms
59,292 KB
testcase_24 AC 225 ms
59,244 KB
testcase_25 AC 126 ms
55,972 KB
testcase_26 AC 126 ms
55,888 KB
testcase_27 AC 127 ms
55,872 KB
testcase_28 AC 125 ms
56,316 KB
testcase_29 AC 126 ms
56,088 KB
testcase_30 AC 127 ms
55,840 KB
testcase_31 AC 128 ms
55,968 KB
testcase_32 AC 127 ms
56,124 KB
testcase_33 AC 127 ms
55,884 KB
testcase_34 AC 125 ms
55,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder40 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int d = sc.nextInt();
        int[] a = new int[d + 1];
        for (int i = 0; i <= d; i++) {
        	a[i] = sc.nextInt();
        }
        
        for (int i = d; i >= 3; i--) {
        	a[i - 2] -= -a[i];
        	a[i] = 0;
        }

        if (d > 1 && a[2] != 0) {
        	System.out.println("2");
        	System.out.printf("%d %d %d\n", a[0], a[1], a[2]);
        } else if (d > 0 && a[1] != 0) {
        	System.out.println("1");
        	System.out.printf("%d %d\n", a[0], a[1]);
        } else {
        	System.out.println("0");
        	System.out.printf("%d\n", a[0]);
        }

        sc.close();
    }
}
0