結果

問題 No.3232 Not Tic Tac Toe
ユーザー ks2m
提出日時 2025-08-15 22:40:19
言語 Java
(openjdk 23)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 2,595 ms
コンパイル使用メモリ 86,548 KB
実行使用メモリ 51,424 KB
最終ジャッジ日時 2025-08-15 22:40:32
合計ジャッジ時間 11,244 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		for (int i = 0; i < h; i++) {
			StringBuilder sb = new StringBuilder();
			for (int j = 0; j < w; j++) {
				if (i % 2 == 0 ^ j % 4 < 2) {
					sb.append('O');
				} else {
					sb.append('X');
				}
			}
			System.out.println(sb.toString());
		}
	}
}
0