結果

問題 No.796 well known
ユーザー tentententen
提出日時 2020-10-09 09:10:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 512 bytes
コンパイル時間 2,037 ms
コンパイル使用メモリ 71,744 KB
実行使用メモリ 58,132 KB
最終ジャッジ日時 2023-09-27 12:32:38
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
55,528 KB
testcase_01 AC 105 ms
55,760 KB
testcase_02 AC 105 ms
55,952 KB
testcase_03 AC 102 ms
55,712 KB
testcase_04 AC 147 ms
53,592 KB
testcase_05 AC 144 ms
55,652 KB
testcase_06 AC 155 ms
57,908 KB
testcase_07 AC 135 ms
55,488 KB
testcase_08 AC 140 ms
55,680 KB
testcase_09 AC 131 ms
55,820 KB
testcase_10 AC 153 ms
58,132 KB
testcase_11 AC 127 ms
56,212 KB
testcase_12 AC 127 ms
55,448 KB
testcase_13 AC 144 ms
55,712 KB
testcase_14 AC 137 ms
55,488 KB
testcase_15 AC 129 ms
55,944 KB
testcase_16 AC 154 ms
57,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        Arrays.fill(arr, 1);
        arr[0] = 4 - (n - 2) % 3;
        arr[1] = 3;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            if (i > 0) {
                sb.append(" ");
            }
            sb.append(arr[i]);
        }
       System.out.println(sb);
    }
}
0