結果
| 問題 |
No.839 Keep Distance and Nobody Explodes
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-06-15 04:08:27 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 799 bytes |
| コンパイル時間 | 2,640 ms |
| コンパイル使用メモリ | 79,448 KB |
| 実行使用メモリ | 54,844 KB |
| 最終ジャッジ日時 | 2024-11-16 19:03:28 |
| 合計ジャッジ時間 | 17,696 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 29 |
ソースコード
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[][] ans = new int[N][N];
for (int i = 0; i < N / 2; ++i) {
for (int j = 0; j < N / 2; ++j) {
ans[i][j] = 2 * i * (N / 2) + 2 * j + 1;
ans[i + N / 2][j + N / 2] = ans[i][j] + 1;
ans[i][j + N / 2] = ans[i][j] + 2 * (N / 2) * (N / 2);
ans[i + N / 2][j] = ans[i + N / 2][j + N / 2] + 2 * (N / 2) * (N / 2);
}
}
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
System.out.print(ans[i][j] + (j == N - 1 ? "\n" : " "));
}
}
}
void tr(Object... objects) {
System.out.println(Arrays.deepToString(objects));
}
}