結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー Lo_OTLo_OT
提出日時 2018-03-14 22:19:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 583 bytes
コンパイル時間 2,375 ms
コンパイル使用メモリ 76,108 KB
実行使用メモリ 41,320 KB
最終ジャッジ日時 2024-04-29 08:31:14
合計ジャッジ時間 6,653 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
40,952 KB
testcase_01 AC 128 ms
41,116 KB
testcase_02 AC 118 ms
39,796 KB
testcase_03 AC 127 ms
41,140 KB
testcase_04 AC 126 ms
40,872 KB
testcase_05 AC 126 ms
41,144 KB
testcase_06 AC 125 ms
41,072 KB
testcase_07 AC 127 ms
40,948 KB
testcase_08 AC 130 ms
41,244 KB
testcase_09 AC 126 ms
41,216 KB
testcase_10 AC 115 ms
40,224 KB
testcase_11 AC 113 ms
39,932 KB
testcase_12 AC 118 ms
40,756 KB
testcase_13 AC 126 ms
41,320 KB
testcase_14 AC 125 ms
40,984 KB
testcase_15 AC 126 ms
40,984 KB
testcase_16 AC 113 ms
39,940 KB
testcase_17 AC 114 ms
39,940 KB
testcase_18 AC 126 ms
41,124 KB
testcase_19 AC 126 ms
40,960 KB
testcase_20 AC 113 ms
39,700 KB
testcase_21 AC 115 ms
39,860 KB
testcase_22 AC 131 ms
41,192 KB
testcase_23 AC 112 ms
40,260 KB
testcase_24 AC 123 ms
40,892 KB
testcase_25 AC 123 ms
41,008 KB
testcase_26 AC 125 ms
40,984 KB
testcase_27 AC 125 ms
40,988 KB
testcase_28 AC 126 ms
40,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int weekday = 0;
        String days = in.nextLine();
        days += in.nextLine();

        for(int i=0, current=0; i<days.length(); i++){
            if(days.charAt(i) == 'o'){
                current++;
            } else {
                current = 0;
            }
            
            if(weekday < current){
                weekday = current;
            }
        }
        System.out.println(weekday);
   }
}
0