結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー dazydazy
提出日時 2017-02-23 17:50:28
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 618 bytes
コンパイル時間 3,543 ms
コンパイル使用メモリ 74,068 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-08-11 16:29:51
合計ジャッジ時間 7,977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,716 KB
testcase_01 AC 117 ms
55,356 KB
testcase_02 AC 117 ms
55,704 KB
testcase_03 AC 117 ms
55,644 KB
testcase_04 AC 118 ms
55,832 KB
testcase_05 AC 120 ms
55,820 KB
testcase_06 AC 121 ms
56,056 KB
testcase_07 AC 122 ms
55,904 KB
testcase_08 AC 121 ms
56,140 KB
testcase_09 AC 117 ms
55,900 KB
testcase_10 AC 119 ms
56,352 KB
testcase_11 AC 118 ms
55,876 KB
testcase_12 AC 117 ms
55,952 KB
testcase_13 AC 121 ms
55,404 KB
testcase_14 AC 117 ms
55,924 KB
testcase_15 AC 123 ms
55,932 KB
testcase_16 AC 115 ms
56,160 KB
testcase_17 AC 118 ms
55,820 KB
testcase_18 AC 116 ms
55,884 KB
testcase_19 AC 120 ms
55,976 KB
testcase_20 AC 120 ms
55,756 KB
testcase_21 AC 122 ms
55,960 KB
testcase_22 AC 118 ms
55,844 KB
testcase_23 AC 118 ms
55,652 KB
testcase_24 AC 121 ms
55,756 KB
testcase_25 AC 121 ms
55,652 KB
testcase_26 AC 120 ms
55,380 KB
testcase_27 AC 122 ms
55,708 KB
testcase_28 AC 122 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int ans = 0;
        int tmp = 0;
        boolean con = false;
        String days = scan.next() + scan.next();

        for (int i = 0; i < 14; i++) {
            if (days.substring(i, i+1).equals("o")) {
                if (con) tmp++;
                else tmp = 1;
                if (tmp > ans) ans = tmp;
                con = true;
            } else {
                tmp = 0;
                con = false;
            }
        }

        System.out.println(ans);
    }
}
0