結果

問題 No.908 うしたぷにきあくん文字列
ユーザー iwa_choco_168iwa_choco_168
提出日時 2019-12-02 09:07:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 73,852 KB
実行使用メモリ 41,344 KB
最終ジャッジ日時 2024-05-02 21:05:53
合計ジャッジ時間 5,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
40,956 KB
testcase_01 AC 129 ms
40,940 KB
testcase_02 AC 129 ms
41,048 KB
testcase_03 AC 128 ms
40,944 KB
testcase_04 AC 133 ms
41,344 KB
testcase_05 AC 111 ms
40,076 KB
testcase_06 AC 126 ms
41,060 KB
testcase_07 AC 131 ms
41,032 KB
testcase_08 AC 128 ms
41,032 KB
testcase_09 AC 129 ms
41,136 KB
testcase_10 AC 116 ms
40,088 KB
testcase_11 AC 124 ms
41,280 KB
testcase_12 AC 113 ms
40,124 KB
testcase_13 AC 118 ms
41,068 KB
testcase_14 AC 112 ms
40,528 KB
testcase_15 AC 115 ms
41,152 KB
testcase_16 AC 109 ms
39,808 KB
testcase_17 AC 126 ms
41,052 KB
testcase_18 AC 128 ms
41,320 KB
testcase_19 AC 126 ms
41,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        boolean flag = true;
        char temp;
        for(int i = 0; i < str.length(); i++) {
            temp = str.charAt(i);
            if(i % 2 == 0 && temp == ' ') flag = false;
            else if(i % 2 == 1 && temp != ' ') flag = false;
        }
        System.out.println((flag)? "Yes" : "No");
    }
}
0