結果

問題 No.908 うしたぷにきあくん文字列
ユーザー htensaihtensai
提出日時 2019-11-11 08:09:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 514 bytes
コンパイル時間 2,192 ms
コンパイル使用メモリ 70,820 KB
実行使用メモリ 57,724 KB
最終ジャッジ日時 2023-10-13 07:55:45
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,888 KB
testcase_01 AC 116 ms
55,872 KB
testcase_02 AC 116 ms
55,676 KB
testcase_03 AC 116 ms
55,548 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 116 ms
56,240 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 117 ms
54,432 KB
testcase_11 AC 115 ms
55,492 KB
testcase_12 WA -
testcase_13 AC 114 ms
55,756 KB
testcase_14 WA -
testcase_15 AC 115 ms
55,616 KB
testcase_16 WA -
testcase_17 AC 115 ms
55,860 KB
testcase_18 WA -
testcase_19 AC 114 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0) {
		        if (arr[i] < 'a' || arr[i] > 'z') {
		            System.out.println("No");
		            return;
		        }
		    } else {
		        if (arr[i] != ' ') {
		            System.out.println("No");
		            return;
		        }
		    }
		}
		System.out.println("Yes");
	}
}
0