結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー jp_stejp_ste
提出日時 2016-05-12 01:24:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 743 bytes
コンパイル時間 2,519 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 57,476 KB
最終ジャッジ日時 2023-08-11 16:09:57
合計ジャッジ時間 7,618 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
53,436 KB
testcase_01 AC 129 ms
55,300 KB
testcase_02 AC 127 ms
55,544 KB
testcase_03 AC 127 ms
55,608 KB
testcase_04 AC 127 ms
55,436 KB
testcase_05 AC 129 ms
55,768 KB
testcase_06 AC 128 ms
55,444 KB
testcase_07 AC 129 ms
55,556 KB
testcase_08 AC 130 ms
55,480 KB
testcase_09 AC 124 ms
55,552 KB
testcase_10 AC 130 ms
55,568 KB
testcase_11 AC 130 ms
55,428 KB
testcase_12 AC 128 ms
55,424 KB
testcase_13 AC 131 ms
55,592 KB
testcase_14 AC 129 ms
55,312 KB
testcase_15 AC 129 ms
55,424 KB
testcase_16 AC 129 ms
55,320 KB
testcase_17 AC 130 ms
57,476 KB
testcase_18 AC 130 ms
55,316 KB
testcase_19 AC 131 ms
55,440 KB
testcase_20 AC 129 ms
53,560 KB
testcase_21 AC 129 ms
55,572 KB
testcase_22 AC 129 ms
55,572 KB
testcase_23 AC 128 ms
55,632 KB
testcase_24 AC 128 ms
55,612 KB
testcase_25 AC 127 ms
55,552 KB
testcase_26 AC 128 ms
55,504 KB
testcase_27 AC 130 ms
55,580 KB
testcase_28 AC 128 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner scan = new Scanner(System.in)) {
            String str = scan.next() + scan.next();
            int max = 0;
            for(int i=0; i<str.length(); i++) {
                if(str.charAt(i) == 'o') {
                    int count = 0;
                    for(int j=i; j<str.length(); j++) {
                        if(str.charAt(j) == 'o') {
                            count++;
                        } else {
                            break;
                        }
                    }
                    max = Math.max(max, count);
                }
            }
            System.out.println(max);
        }
    }
}
0