結果

問題 No.40 多項式の割り算
ユーザー ぴろずぴろず
提出日時 2014-12-21 12:31:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 239 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 3,164 ms
コンパイル使用メモリ 73,008 KB
実行使用メモリ 59,848 KB
最終ジャッジ日時 2023-09-02 20:44:03
合計ジャッジ時間 9,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,636 KB
testcase_01 AC 125 ms
56,048 KB
testcase_02 AC 126 ms
56,072 KB
testcase_03 AC 126 ms
55,576 KB
testcase_04 AC 211 ms
59,328 KB
testcase_05 AC 228 ms
59,412 KB
testcase_06 AC 239 ms
59,708 KB
testcase_07 AC 235 ms
59,444 KB
testcase_08 AC 152 ms
56,052 KB
testcase_09 AC 219 ms
59,584 KB
testcase_10 AC 230 ms
59,436 KB
testcase_11 AC 209 ms
58,756 KB
testcase_12 AC 200 ms
58,872 KB
testcase_13 AC 234 ms
59,848 KB
testcase_14 AC 217 ms
59,040 KB
testcase_15 AC 211 ms
59,020 KB
testcase_16 AC 233 ms
59,336 KB
testcase_17 AC 193 ms
58,912 KB
testcase_18 AC 225 ms
59,252 KB
testcase_19 AC 234 ms
59,568 KB
testcase_20 AC 209 ms
58,816 KB
testcase_21 AC 192 ms
58,520 KB
testcase_22 AC 196 ms
59,368 KB
testcase_23 AC 208 ms
59,360 KB
testcase_24 AC 217 ms
58,936 KB
testcase_25 AC 122 ms
55,800 KB
testcase_26 AC 122 ms
58,012 KB
testcase_27 AC 121 ms
55,708 KB
testcase_28 AC 122 ms
56,172 KB
testcase_29 AC 121 ms
55,804 KB
testcase_30 AC 123 ms
55,912 KB
testcase_31 AC 125 ms
55,812 KB
testcase_32 AC 123 ms
56,080 KB
testcase_33 AC 124 ms
55,864 KB
testcase_34 AC 122 ms
55,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no040;

import java.util.Scanner;

public class Main {

	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=0;i<=d-3;i++) {
			a[d-i-2] += a[d-i];
			a[d-i] = 0;
		}
		int d_ = 0;
		for(int i=0;i<=d;i++) {
			if (a[i] != 0) {
				d_ = i;
			}
		}
		System.out.println(d_);
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<=d_;i++) {
			if (i > 0) {
				sb.append(' ');
			}
			sb.append(a[i]);
		}
		System.out.println(sb.toString());
	}

}
0