結果

問題 No.40 多項式の割り算
ユーザー kano_townkano_town
提出日時 2014-11-22 12:29:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 3,821 ms
コンパイル使用メモリ 74,440 KB
実行使用メモリ 60,564 KB
最終ジャッジ日時 2023-08-30 22:12:12
合計ジャッジ時間 12,117 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
56,144 KB
testcase_02 AC 120 ms
56,108 KB
testcase_03 AC 138 ms
56,104 KB
testcase_04 AC 231 ms
59,628 KB
testcase_05 AC 243 ms
60,156 KB
testcase_06 AC 254 ms
60,072 KB
testcase_07 AC 257 ms
60,260 KB
testcase_08 AC 156 ms
56,524 KB
testcase_09 AC 239 ms
59,184 KB
testcase_10 AC 254 ms
59,704 KB
testcase_11 AC 231 ms
59,404 KB
testcase_12 AC 210 ms
59,488 KB
testcase_13 AC 250 ms
60,252 KB
testcase_14 AC 234 ms
59,140 KB
testcase_15 AC 233 ms
59,276 KB
testcase_16 AC 250 ms
60,400 KB
testcase_17 AC 210 ms
59,156 KB
testcase_18 AC 251 ms
59,896 KB
testcase_19 AC 264 ms
60,564 KB
testcase_20 AC 228 ms
59,748 KB
testcase_21 AC 212 ms
58,852 KB
testcase_22 AC 212 ms
59,152 KB
testcase_23 AC 231 ms
59,384 KB
testcase_24 AC 243 ms
59,964 KB
testcase_25 AC 134 ms
53,892 KB
testcase_26 AC 137 ms
56,100 KB
testcase_27 AC 135 ms
56,268 KB
testcase_28 WA -
testcase_29 AC 134 ms
56,492 KB
testcase_30 AC 133 ms
56,180 KB
testcase_31 AC 135 ms
56,348 KB
testcase_32 AC 134 ms
56,136 KB
testcase_33 AC 132 ms
55,928 KB
testcase_34 AC 131 ms
55,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder40 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt() + 1;
		int[] a = new int[D];
		for (int i = 0; i < D; i++) a[D - i - 1] = sc.nextInt();

		for (int i = 0; i < D - 3; i++) {
			a[i + 2] += a[i];
			a[i] = 0;
		}

		int num = 0;
		for (int i = 0; i < D - 1; i++) if (a[i] != 0) num++;
		System.out.println(num);
		if (num == 0) System.out.print(0);
		else for (int i = 0; i < num + 1; i++) System.out.print(a[D - i - 1] + " ");
		System.out.println();
	}
}
0