結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 17:54:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 2,357 ms
コンパイル使用メモリ 76,348 KB
実行使用メモリ 41,404 KB
最終ジャッジ日時 2024-04-28 19:37:39
合計ジャッジ時間 7,113 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,168 KB
testcase_01 AC 125 ms
41,064 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 130 ms
40,940 KB
testcase_08 AC 129 ms
41,136 KB
testcase_09 AC 129 ms
41,216 KB
testcase_10 AC 131 ms
41,292 KB
testcase_11 AC 129 ms
41,064 KB
testcase_12 AC 130 ms
41,032 KB
testcase_13 AC 131 ms
41,208 KB
testcase_14 AC 128 ms
41,176 KB
testcase_15 AC 127 ms
41,072 KB
testcase_16 AC 132 ms
41,144 KB
testcase_17 AC 129 ms
41,072 KB
testcase_18 AC 129 ms
41,076 KB
testcase_19 AC 130 ms
41,216 KB
testcase_20 AC 134 ms
41,192 KB
testcase_21 AC 124 ms
41,224 KB
testcase_22 AC 128 ms
41,076 KB
testcase_23 AC 112 ms
39,952 KB
testcase_24 AC 128 ms
41,176 KB
testcase_25 AC 127 ms
41,040 KB
testcase_26 AC 129 ms
41,316 KB
testcase_27 AC 133 ms
41,280 KB
testcase_28 AC 129 ms
41,000 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 = -1001001001;
		for(int i = 0 ; i < 14 ; i++) {
			if(s[i].equals("o")) {
				for(int j = i + 1 ; j < 14 ; j++) {
					if(s[j].equals("o")) {
						ans = Math.max(ans, j - i + 1);
					} else {
						break;
					}
				}
			}
		}
		if(ans == -1001001001) {
			System.out.println(0);
		} else {
			System.out.println(ans);
		}
 	}
}
0