結果

問題 No.1971 Easy Sudoku
ユーザー ks2mks2m
提出日時 2022-06-10 22:11:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 3,316 ms
コンパイル使用メモリ 83,824 KB
実行使用メモリ 57,832 KB
最終ジャッジ日時 2023-10-21 05:17:58
合計ジャッジ時間 6,177 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,464 KB
testcase_01 AC 117 ms
56,328 KB
testcase_02 AC 154 ms
57,600 KB
testcase_03 AC 121 ms
56,836 KB
testcase_04 AC 146 ms
57,628 KB
testcase_05 AC 120 ms
57,548 KB
testcase_06 AC 111 ms
56,328 KB
testcase_07 AC 154 ms
57,488 KB
testcase_08 AC 115 ms
56,300 KB
testcase_09 AC 134 ms
57,448 KB
testcase_10 AC 133 ms
57,652 KB
testcase_11 AC 128 ms
57,680 KB
testcase_12 AC 115 ms
56,336 KB
testcase_13 AC 163 ms
57,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		for (int i = 0; i < n; i++) {
			StringBuilder sb = new StringBuilder();
			for (int j = 0; j < n; j++) {
				sb.append((i + j) % n + 1).append(' ');
			}
			sb.deleteCharAt(sb.length() - 1);
			System.out.println(sb.toString());
		}
	}
}
0