結果

問題 No.908 うしたぷにきあくん文字列
ユーザー ks2mks2m
提出日時 2019-10-18 21:23:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 2,185 ms
コンパイル使用メモリ 71,820 KB
実行使用メモリ 49,756 KB
最終ジャッジ日時 2023-09-07 21:06:48
合計ジャッジ時間 4,036 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,352 KB
testcase_01 AC 44 ms
49,360 KB
testcase_02 AC 43 ms
49,256 KB
testcase_03 AC 44 ms
49,288 KB
testcase_04 AC 42 ms
49,652 KB
testcase_05 AC 42 ms
49,472 KB
testcase_06 AC 41 ms
49,412 KB
testcase_07 AC 42 ms
49,756 KB
testcase_08 AC 41 ms
49,128 KB
testcase_09 AC 40 ms
49,216 KB
testcase_10 AC 41 ms
49,648 KB
testcase_11 AC 41 ms
49,248 KB
testcase_12 AC 40 ms
49,124 KB
testcase_13 AC 41 ms
49,468 KB
testcase_14 AC 44 ms
49,620 KB
testcase_15 AC 45 ms
49,340 KB
testcase_16 AC 42 ms
49,356 KB
testcase_17 AC 40 ms
49,300 KB
testcase_18 AC 42 ms
49,256 KB
testcase_19 AC 44 ms
49,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		br.close();

		for (int i = 0; i < s.length(); i++) {
			if (i % 2 == 1) {
				if (s.charAt(i) != ' ') {
					System.out.println("No");
					return;
				}
			} else {
				if (s.charAt(i) == ' ') {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}
0