結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 17:54:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 2,242 ms
コンパイル使用メモリ 73,304 KB
実行使用メモリ 58,064 KB
最終ジャッジ日時 2023-08-11 02:29:33
合計ジャッジ時間 7,083 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,960 KB
testcase_01 AC 123 ms
56,272 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 119 ms
55,596 KB
testcase_08 AC 119 ms
55,864 KB
testcase_09 AC 120 ms
55,956 KB
testcase_10 AC 120 ms
55,628 KB
testcase_11 AC 121 ms
55,420 KB
testcase_12 AC 123 ms
55,896 KB
testcase_13 AC 122 ms
55,640 KB
testcase_14 AC 121 ms
56,116 KB
testcase_15 AC 120 ms
56,112 KB
testcase_16 AC 122 ms
55,900 KB
testcase_17 AC 120 ms
53,864 KB
testcase_18 AC 121 ms
55,840 KB
testcase_19 AC 121 ms
55,788 KB
testcase_20 AC 127 ms
55,968 KB
testcase_21 AC 122 ms
55,988 KB
testcase_22 AC 119 ms
55,624 KB
testcase_23 AC 124 ms
55,456 KB
testcase_24 AC 122 ms
55,940 KB
testcase_25 AC 122 ms
55,840 KB
testcase_26 AC 123 ms
56,028 KB
testcase_27 AC 123 ms
56,012 KB
testcase_28 AC 122 ms
55,784 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