結果

問題 No.2410 Nine Numbers
コンテスト
ユーザー shojin_pro
提出日時 2023-08-11 23:04:26
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 28 ms / 2,000 ms
+ 862µs
コード長 895 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,054 ms
コンパイル使用メモリ 85,216 KB
実行使用メモリ 42,604 KB
最終ジャッジ日時 2026-09-25 23:48:34
合計ジャッジ時間 2,873 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int now = 1;
        StringBuilder sb = new StringBuilder();
        //int[] arr = new int[9];
        for(int i = 0; i < 9; i++){
            //arr[i] = now;
            sb.append(now).append(" ");
            now *= 3;
        }
        /*
        HashSet<Integer> set = new HashSet<>();
        set.add(0);
        for(int i = 0; i < 9; i++){
            HashSet<Integer> next = new HashSet<>();
            for(int v : set){
                next.add(v);
                next.add(v-arr[i]);
                next.add(v+arr[i]);
            }
            set = next;
        }
        for(int i = 1; i <= 9000; i++){
            if(!set.contains(i)){
                System.out.println(i);
            }
        }
        */
        System.out.println(sb.toString().trim());
    }
}
0