結果

問題 No.40 多項式の割り算
ユーザー GrenacheGrenache
提出日時 2015-11-03 16:44:14
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 769 bytes
コンパイル時間 4,492 ms
コンパイル使用メモリ 72,384 KB
実行使用メモリ 60,008 KB
最終ジャッジ日時 2023-10-11 13:25:10
合計ジャッジ時間 12,042 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
56,028 KB
testcase_01 AC 130 ms
56,060 KB
testcase_02 AC 130 ms
55,568 KB
testcase_03 AC 128 ms
55,888 KB
testcase_04 AC 220 ms
59,504 KB
testcase_05 AC 228 ms
57,376 KB
testcase_06 AC 245 ms
59,516 KB
testcase_07 AC 244 ms
59,764 KB
testcase_08 AC 155 ms
56,496 KB
testcase_09 AC 230 ms
59,076 KB
testcase_10 AC 237 ms
59,696 KB
testcase_11 AC 221 ms
59,628 KB
testcase_12 AC 208 ms
58,728 KB
testcase_13 AC 240 ms
59,368 KB
testcase_14 AC 224 ms
59,940 KB
testcase_15 AC 212 ms
59,256 KB
testcase_16 AC 242 ms
60,008 KB
testcase_17 AC 193 ms
58,748 KB
testcase_18 AC 235 ms
59,300 KB
testcase_19 AC 244 ms
59,568 KB
testcase_20 AC 213 ms
59,380 KB
testcase_21 AC 197 ms
58,600 KB
testcase_22 AC 199 ms
58,168 KB
testcase_23 AC 213 ms
59,192 KB
testcase_24 AC 234 ms
59,440 KB
testcase_25 AC 127 ms
55,832 KB
testcase_26 AC 128 ms
55,888 KB
testcase_27 AC 127 ms
55,752 KB
testcase_28 RE -
testcase_29 AC 130 ms
55,984 KB
testcase_30 AC 128 ms
56,052 KB
testcase_31 AC 129 ms
56,168 KB
testcase_32 AC 126 ms
55,984 KB
testcase_33 AC 131 ms
55,620 KB
testcase_34 AC 128 ms
56,252 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 (a[2] != 0) {
        	System.out.println("2");
        	System.out.printf("%d %d %d\n", a[0], a[1], a[2]);
        } else if (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