結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー 4A9GN4A9GN
提出日時 2016-07-22 23:30:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 679 bytes
コンパイル時間 2,281 ms
コンパイル使用メモリ 75,456 KB
実行使用メモリ 41,400 KB
最終ジャッジ日時 2024-04-29 08:08:23
合計ジャッジ時間 7,052 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,400 KB
testcase_01 AC 113 ms
39,800 KB
testcase_02 AC 128 ms
41,060 KB
testcase_03 AC 129 ms
41,224 KB
testcase_04 AC 131 ms
41,148 KB
testcase_05 AC 126 ms
40,932 KB
testcase_06 AC 133 ms
41,064 KB
testcase_07 AC 128 ms
41,176 KB
testcase_08 AC 135 ms
41,260 KB
testcase_09 AC 134 ms
40,928 KB
testcase_10 AC 130 ms
41,148 KB
testcase_11 AC 131 ms
41,196 KB
testcase_12 AC 129 ms
41,140 KB
testcase_13 AC 127 ms
41,224 KB
testcase_14 AC 115 ms
40,024 KB
testcase_15 AC 129 ms
41,008 KB
testcase_16 AC 128 ms
41,184 KB
testcase_17 AC 130 ms
40,956 KB
testcase_18 AC 128 ms
41,352 KB
testcase_19 AC 127 ms
40,944 KB
testcase_20 AC 135 ms
41,056 KB
testcase_21 AC 125 ms
40,832 KB
testcase_22 AC 129 ms
41,120 KB
testcase_23 AC 114 ms
39,864 KB
testcase_24 AC 128 ms
41,216 KB
testcase_25 AC 126 ms
41,132 KB
testcase_26 AC 127 ms
41,244 KB
testcase_27 AC 128 ms
41,384 KB
testcase_28 AC 128 ms
41,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Character> al = new ArrayList<Character>();
        String s = sc.next();
        for (char c : s.toCharArray()) al.add(c);
        s = sc.next();
        for (char c : s.toCharArray()) al.add(c);

        int i, c = 0, m = 0;
        char f;
        for (i = 0; i < al.size(); i++) {
            f = al.get(i);
            if (f == 'x') {
                if (m < c) m = c;
                c = 0;
            } else c++;
        }
        if (m < c) m = c;
        System.out.printf("%d\n", m);
    }
}
0