結果
| 問題 | No.1399 すごろくで世界旅行 (構築) | 
| コンテスト | |
| ユーザー |  shojin_pro | 
| 提出日時 | 2021-02-19 22:56:07 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,973 ms / 3,153 ms | 
| コード長 | 819 bytes | 
| コンパイル時間 | 2,217 ms | 
| コンパイル使用メモリ | 74,404 KB | 
| 実行使用メモリ | 59,432 KB | 
| 最終ジャッジ日時 | 2024-09-16 21:39:49 | 
| 合計ジャッジ時間 | 37,100 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 22 | 
ソースコード
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();
            }
        }
        
    }
}
            
            
            
        