結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー jimanojimano
提出日時 2018-01-13 18:12:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 543 bytes
コンパイル時間 3,675 ms
コンパイル使用メモリ 75,884 KB
実行使用メモリ 41,304 KB
最終ジャッジ日時 2024-04-29 08:29:28
合計ジャッジ時間 8,043 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,220 KB
testcase_01 AC 112 ms
39,856 KB
testcase_02 AC 127 ms
40,944 KB
testcase_03 AC 113 ms
39,928 KB
testcase_04 AC 124 ms
40,912 KB
testcase_05 AC 126 ms
41,036 KB
testcase_06 AC 115 ms
40,104 KB
testcase_07 AC 114 ms
39,940 KB
testcase_08 AC 126 ms
41,040 KB
testcase_09 AC 117 ms
39,896 KB
testcase_10 AC 126 ms
41,024 KB
testcase_11 AC 125 ms
40,960 KB
testcase_12 AC 125 ms
41,304 KB
testcase_13 AC 128 ms
41,056 KB
testcase_14 AC 126 ms
41,188 KB
testcase_15 AC 124 ms
41,096 KB
testcase_16 AC 125 ms
41,276 KB
testcase_17 AC 125 ms
41,176 KB
testcase_18 AC 124 ms
41,148 KB
testcase_19 AC 124 ms
40,952 KB
testcase_20 AC 124 ms
40,860 KB
testcase_21 AC 111 ms
39,984 KB
testcase_22 AC 110 ms
40,172 KB
testcase_23 AC 121 ms
40,124 KB
testcase_24 AC 127 ms
41,196 KB
testcase_25 AC 122 ms
41,084 KB
testcase_26 AC 124 ms
40,828 KB
testcase_27 AC 126 ms
41,000 KB
testcase_28 AC 128 ms
41,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.util.Scanner;

public class No0203 {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int cntHolidays = 0;
			int tmp = 0;
			String s = sc.nextLine() + sc.nextLine();
			char[] c = s.toCharArray();
			
			for (int i = 0; i < 14; i++) {
				if (c[i] == 'o') {
					tmp++;
				}
				if (c[i] == 'x') {
					cntHolidays = Math.max(cntHolidays, tmp);
					tmp = 0;
				}
			}
			cntHolidays = Math.max(cntHolidays, tmp);
			System.out.println(cntHolidays);
		}
	}
}
0