結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー shojin_proshojin_pro
提出日時 2021-02-19 22:56:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 2,219 ms / 3,153 ms
コード長 819 bytes
コンパイル時間 2,113 ms
コンパイル使用メモリ 71,352 KB
実行使用メモリ 68,644 KB
最終ジャッジ日時 2023-10-15 04:09:17
合計ジャッジ時間 38,292 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,496 KB
testcase_01 AC 125 ms
55,784 KB
testcase_02 AC 129 ms
55,832 KB
testcase_03 AC 124 ms
55,652 KB
testcase_04 AC 127 ms
55,788 KB
testcase_05 AC 125 ms
55,836 KB
testcase_06 AC 126 ms
56,324 KB
testcase_07 AC 126 ms
55,968 KB
testcase_08 AC 125 ms
56,228 KB
testcase_09 AC 125 ms
55,860 KB
testcase_10 AC 128 ms
55,456 KB
testcase_11 AC 123 ms
56,176 KB
testcase_12 AC 125 ms
55,980 KB
testcase_13 AC 125 ms
56,104 KB
testcase_14 AC 125 ms
55,816 KB
testcase_15 AC 129 ms
56,036 KB
testcase_16 AC 126 ms
55,980 KB
testcase_17 AC 2,174 ms
67,036 KB
testcase_18 AC 2,110 ms
63,968 KB
testcase_19 AC 2,130 ms
64,644 KB
testcase_20 AC 2,164 ms
63,672 KB
testcase_21 AC 2,219 ms
67,088 KB
testcase_22 AC 2,188 ms
68,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        if(d == 1){
            for(int i = 0; i < n; i++){
                for(int j = 0; j < n; j++){
                    System.out.print(1);
                }
                System.out.println();
            }
        }else{
            for(int i = 0; i < n; i++){
                for(int j = 0; j < n; j++){
                    if(i == 0 || j == 0){
                        System.out.print(1);
                    }else{
                        System.out.print(0);
                    }
                }
                System.out.println();
            }
        }
        
    }

}
0