結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 18:01:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 514 bytes
コンパイル時間 2,819 ms
コンパイル使用メモリ 77,300 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-04-29 08:26:33
合計ジャッジ時間 6,999 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,500 KB
testcase_01 AC 129 ms
41,140 KB
testcase_02 AC 130 ms
41,056 KB
testcase_03 AC 117 ms
40,176 KB
testcase_04 AC 119 ms
39,792 KB
testcase_05 AC 129 ms
41,284 KB
testcase_06 AC 131 ms
41,204 KB
testcase_07 AC 129 ms
41,232 KB
testcase_08 AC 131 ms
41,132 KB
testcase_09 AC 132 ms
41,124 KB
testcase_10 AC 131 ms
40,828 KB
testcase_11 AC 131 ms
41,140 KB
testcase_12 AC 129 ms
40,920 KB
testcase_13 AC 128 ms
41,036 KB
testcase_14 AC 128 ms
41,096 KB
testcase_15 AC 132 ms
41,084 KB
testcase_16 AC 117 ms
40,120 KB
testcase_17 AC 128 ms
40,988 KB
testcase_18 AC 132 ms
41,500 KB
testcase_19 AC 133 ms
41,076 KB
testcase_20 AC 132 ms
40,812 KB
testcase_21 AC 129 ms
40,864 KB
testcase_22 AC 128 ms
41,224 KB
testcase_23 AC 115 ms
39,932 KB
testcase_24 AC 127 ms
41,204 KB
testcase_25 AC 127 ms
41,144 KB
testcase_26 AC 125 ms
41,252 KB
testcase_27 AC 116 ms
40,132 KB
testcase_28 AC 129 ms
41,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = new String[14];
		String s1 = sc.next() + sc.next();
		for(int i = 0 ; i < 14 ; i++) s[i] = "" + s1.charAt(i);
		int ans = 0;
		for(int i = 0 ; i < 14 ; i++) {
			if(s[i].equals("o")) {
				for(int j = i ; j < 14 ; j++) {
					if(s[j].equals("o")) {
						ans = Math.max(ans, j - i + 1);
					} else {
						break;
					}
				}
			}
		}
		System.out.println(ans);
 	}
}
0