結果

問題 No.796 well known
ユーザー キョウチクキョウチク
提出日時 2022-05-15 18:27:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 602 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 5,776 ms
コンパイル使用メモリ 73,624 KB
実行使用メモリ 66,916 KB
最終ジャッジ日時 2023-10-11 04:26:59
合計ジャッジ時間 12,756 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
55,860 KB
testcase_01 AC 138 ms
55,920 KB
testcase_02 AC 139 ms
55,676 KB
testcase_03 AC 142 ms
55,776 KB
testcase_04 AC 597 ms
66,916 KB
testcase_05 AC 512 ms
65,700 KB
testcase_06 AC 539 ms
66,120 KB
testcase_07 AC 359 ms
65,200 KB
testcase_08 AC 512 ms
65,784 KB
testcase_09 AC 518 ms
66,592 KB
testcase_10 AC 547 ms
65,664 KB
testcase_11 AC 306 ms
65,040 KB
testcase_12 AC 462 ms
66,496 KB
testcase_13 AC 602 ms
66,700 KB
testcase_14 AC 401 ms
65,384 KB
testcase_15 AC 492 ms
65,692 KB
testcase_16 AC 559 ms
65,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test10 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String line;
    line=sc.nextLine();
    int n=Integer.parseInt(line);
    int[] num_=new int[n];
    for(int i=0;i<n-2;i++){
      num_[i]=1;
    }
    num_[n-2]=3;
    num_[n-1]=3-(n%3);
    for(int i=0;i<n-1;i++){
      System.out.print(num_[i]+" ");
    }
    System.out.println(num_[n-1]);
    sc.close();
  }
}
0