結果

問題 No.1169 Row and Column and Diagonal
ユーザー tentententen
提出日時 2020-08-25 00:36:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 3,349 ms
コンパイル使用メモリ 71,852 KB
実行使用メモリ 59,488 KB
最終ジャッジ日時 2023-08-06 08:00:53
合計ジャッジ時間 7,186 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,696 KB
testcase_01 AC 126 ms
56,060 KB
testcase_02 AC 126 ms
55,636 KB
testcase_03 AC 125 ms
55,708 KB
testcase_04 AC 127 ms
55,952 KB
testcase_05 AC 128 ms
55,964 KB
testcase_06 AC 164 ms
56,332 KB
testcase_07 AC 174 ms
55,852 KB
testcase_08 AC 171 ms
56,424 KB
testcase_09 AC 196 ms
58,216 KB
testcase_10 AC 219 ms
58,756 KB
testcase_11 AC 223 ms
59,384 KB
testcase_12 AC 225 ms
58,988 KB
testcase_13 AC 232 ms
59,488 KB
testcase_14 AC 229 ms
59,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	StringBuilder sb = new StringBuilder();
    	for (int i = 0; i < n; i++) {
    	    for (int j = 0; j < n; j++) {
    	        if (j > 0) {
    	            sb.append(" ");
    	        }
    	        sb.append((2 * i - j + n) % n + 1);
    	    }
    	    sb.append("\n");
    	}
    	System.out.print(sb);
    }
}

0