結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー MoominPaz
提出日時 2015-10-07 21:28:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 62 ms / 1,000 ms
コード長 967 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 74,912 KB
実行使用メモリ 50,460 KB
最終ジャッジ日時 2024-11-18 09:32:43
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder InputChar = new StringBuilder();
    int Result = 0;
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    void solve() throws IOException {
        for(int i = 0; i < 2; i++) {
            InputChar.append(br.readLine());
        }
        Result = CountUp(InputChar);
        System.out.println(Result);
    }

    int CountUp(StringBuilder WorkInputChar) {
        int WorkResult = 0;
        int Count = 0;
        for(int i = 0; i < WorkInputChar.length(); i++) {
            if(WorkInputChar.charAt(i) == 'o') {
                Count++;
                WorkResult = Math.max(WorkResult, Count);
            } else {
                Count = 0;
            }
        }
        return WorkResult;
    }
}
0