結果

問題 No.908 うしたぷにきあくん文字列
ユーザー d-yoshd-yosh
提出日時 2019-12-09 08:36:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 2,380 ms
コンパイル使用メモリ 72,092 KB
実行使用メモリ 56,224 KB
最終ジャッジ日時 2023-09-02 13:25:06
合計ジャッジ時間 6,007 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,224 KB
testcase_01 AC 120 ms
56,068 KB
testcase_02 AC 124 ms
55,732 KB
testcase_03 AC 121 ms
55,552 KB
testcase_04 AC 122 ms
55,964 KB
testcase_05 AC 121 ms
55,604 KB
testcase_06 AC 121 ms
56,176 KB
testcase_07 AC 120 ms
55,920 KB
testcase_08 AC 122 ms
55,676 KB
testcase_09 AC 121 ms
55,704 KB
testcase_10 AC 120 ms
55,420 KB
testcase_11 AC 122 ms
55,760 KB
testcase_12 AC 121 ms
55,884 KB
testcase_13 AC 122 ms
55,848 KB
testcase_14 AC 121 ms
55,756 KB
testcase_15 AC 122 ms
55,932 KB
testcase_16 AC 122 ms
56,124 KB
testcase_17 AC 123 ms
55,944 KB
testcase_18 AC 119 ms
56,080 KB
testcase_19 AC 120 ms
55,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

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