結果

問題 No.908 うしたぷにきあくん文字列
ユーザー マサマサ
提出日時 2022-01-11 17:12:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 74,144 KB
実行使用メモリ 54,300 KB
最終ジャッジ日時 2024-04-26 20:42:16
合計ジャッジ時間 5,549 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
53,620 KB
testcase_01 AC 114 ms
53,080 KB
testcase_02 AC 127 ms
53,932 KB
testcase_03 AC 110 ms
53,152 KB
testcase_04 AC 126 ms
54,172 KB
testcase_05 AC 126 ms
53,868 KB
testcase_06 AC 126 ms
54,004 KB
testcase_07 AC 127 ms
54,300 KB
testcase_08 AC 129 ms
53,940 KB
testcase_09 AC 125 ms
53,768 KB
testcase_10 AC 130 ms
54,236 KB
testcase_11 AC 130 ms
53,960 KB
testcase_12 AC 130 ms
53,732 KB
testcase_13 AC 128 ms
53,892 KB
testcase_14 AC 129 ms
53,816 KB
testcase_15 AC 129 ms
53,884 KB
testcase_16 AC 128 ms
53,960 KB
testcase_17 AC 126 ms
53,840 KB
testcase_18 AC 127 ms
53,928 KB
testcase_19 AC 128 ms
53,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();

		int i = 0;
    for ( ; i < s.length(); i++) {
    	String c = String.valueOf(s.charAt(i));
      if (i % 2 == 0) {
      	if (c.equals(" ")) {
					break;
				}
      }
			if (i % 2 == 1) {
				if (!(c.equals(" "))) {
					break;
				}
			}
    }

		if (i == s.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}
0