結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー yagi2yagi2
提出日時 2017-04-21 16:41:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 530 bytes
コンパイル時間 2,158 ms
コンパイル使用メモリ 73,364 KB
実行使用メモリ 55,920 KB
最終ジャッジ日時 2023-08-11 16:31:37
合計ジャッジ時間 7,267 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,820 KB
testcase_01 AC 124 ms
55,768 KB
testcase_02 AC 129 ms
55,504 KB
testcase_03 AC 126 ms
55,300 KB
testcase_04 AC 127 ms
55,688 KB
testcase_05 AC 128 ms
55,716 KB
testcase_06 AC 127 ms
55,704 KB
testcase_07 AC 124 ms
55,504 KB
testcase_08 AC 124 ms
55,480 KB
testcase_09 AC 125 ms
55,600 KB
testcase_10 AC 125 ms
55,548 KB
testcase_11 AC 125 ms
55,192 KB
testcase_12 AC 126 ms
55,192 KB
testcase_13 AC 125 ms
55,196 KB
testcase_14 AC 128 ms
55,668 KB
testcase_15 AC 128 ms
55,432 KB
testcase_16 AC 129 ms
55,512 KB
testcase_17 AC 126 ms
55,388 KB
testcase_18 AC 125 ms
55,920 KB
testcase_19 AC 127 ms
53,364 KB
testcase_20 AC 130 ms
55,272 KB
testcase_21 AC 129 ms
55,500 KB
testcase_22 AC 127 ms
55,748 KB
testcase_23 AC 124 ms
55,508 KB
testcase_24 AC 126 ms
55,804 KB
testcase_25 AC 127 ms
55,612 KB
testcase_26 AC 125 ms
55,740 KB
testcase_27 AC 125 ms
55,776 KB
testcase_28 AC 127 ms
55,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

        int num = 0;
        int tmp = 0;
        for (String s : W.split("")) {
            if (s.equals("o")) {
                tmp++;
            }
            if (s.equals("x")) {
                if (num < tmp) num = tmp;
                tmp = 0;
            }
        }
        if (num < tmp) num = tmp;
        System.out.println(num);
    }
}
0