結果

問題 No.40 多項式の割り算
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-06 23:13:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 2,224 ms
コンパイル使用メモリ 71,620 KB
実行使用メモリ 59,852 KB
最終ジャッジ日時 2023-08-18 19:41:12
合計ジャッジ時間 10,731 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 129 ms
55,424 KB
testcase_02 AC 127 ms
56,060 KB
testcase_03 AC 128 ms
55,676 KB
testcase_04 AC 221 ms
59,448 KB
testcase_05 AC 233 ms
59,844 KB
testcase_06 AC 252 ms
59,852 KB
testcase_07 AC 247 ms
59,672 KB
testcase_08 AC 162 ms
56,072 KB
testcase_09 AC 233 ms
58,704 KB
testcase_10 AC 241 ms
59,184 KB
testcase_11 AC 223 ms
59,336 KB
testcase_12 AC 196 ms
58,528 KB
testcase_13 AC 241 ms
59,324 KB
testcase_14 AC 226 ms
59,164 KB
testcase_15 AC 212 ms
59,104 KB
testcase_16 AC 241 ms
59,516 KB
testcase_17 AC 203 ms
58,052 KB
testcase_18 AC 235 ms
59,308 KB
testcase_19 AC 243 ms
59,224 KB
testcase_20 AC 214 ms
59,060 KB
testcase_21 AC 199 ms
58,260 KB
testcase_22 AC 196 ms
58,152 KB
testcase_23 AC 215 ms
58,576 KB
testcase_24 AC 236 ms
58,860 KB
testcase_25 AC 127 ms
55,996 KB
testcase_26 WA -
testcase_27 AC 127 ms
55,676 KB
testcase_28 AC 126 ms
55,948 KB
testcase_29 AC 128 ms
55,680 KB
testcase_30 AC 130 ms
55,680 KB
testcase_31 AC 129 ms
55,532 KB
testcase_32 WA -
testcase_33 AC 127 ms
55,664 KB
testcase_34 AC 128 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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=D; i>=3; i--){
            a[i-2]+=a[i];
            a[i]=0;
        }
        int c=0;
        for(int i=D-3; i>=0; i--){
            if(a[i]!=0){
                c=i;
                break;
            }
        }
        System.out.println(c);
        for(int i=0; i<=c; i++){
            System.out.print(a[i]);
            if(i!=c){System.out.print(" ");}
        }
        System.out.println();
    }
}
0