結果

問題 No.908 うしたぷにきあくん文字列
ユーザー ks2mks2m
提出日時 2019-10-18 21:22:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 5,329 ms
コンパイル使用メモリ 71,608 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-07 21:04:37
合計ジャッジ時間 5,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,772 KB
testcase_01 AC 119 ms
56,108 KB
testcase_02 AC 118 ms
55,820 KB
testcase_03 AC 117 ms
56,092 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 117 ms
55,716 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 119 ms
55,836 KB
testcase_11 AC 118 ms
55,988 KB
testcase_12 WA -
testcase_13 AC 117 ms
55,656 KB
testcase_14 WA -
testcase_15 AC 117 ms
55,544 KB
testcase_16 WA -
testcase_17 AC 117 ms
55,848 KB
testcase_18 WA -
testcase_19 AC 120 ms
55,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.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