結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー discoNekodiscoNeko
提出日時 2016-04-28 23:33:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 654 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 73,024 KB
実行使用メモリ 49,764 KB
最終ジャッジ日時 2023-08-11 16:08:55
合計ジャッジ時間 5,056 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
49,664 KB
testcase_01 AC 48 ms
49,692 KB
testcase_02 AC 47 ms
49,540 KB
testcase_03 AC 47 ms
49,364 KB
testcase_04 AC 48 ms
49,372 KB
testcase_05 AC 47 ms
49,732 KB
testcase_06 AC 47 ms
47,596 KB
testcase_07 AC 47 ms
49,364 KB
testcase_08 AC 48 ms
49,504 KB
testcase_09 AC 47 ms
49,764 KB
testcase_10 AC 48 ms
49,504 KB
testcase_11 AC 48 ms
49,752 KB
testcase_12 AC 47 ms
49,580 KB
testcase_13 AC 47 ms
49,592 KB
testcase_14 AC 47 ms
49,604 KB
testcase_15 AC 48 ms
49,556 KB
testcase_16 AC 47 ms
49,752 KB
testcase_17 AC 47 ms
49,356 KB
testcase_18 AC 47 ms
49,692 KB
testcase_19 AC 48 ms
49,540 KB
testcase_20 AC 48 ms
49,700 KB
testcase_21 AC 48 ms
49,572 KB
testcase_22 AC 48 ms
49,624 KB
testcase_23 AC 48 ms
49,760 KB
testcase_24 AC 47 ms
49,364 KB
testcase_25 AC 47 ms
49,704 KB
testcase_26 AC 48 ms
49,764 KB
testcase_27 AC 47 ms
49,572 KB
testcase_28 AC 47 ms
49,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
 
public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String a = br.readLine()+ br.readLine();
		int l = a.length();
		int chain = 0;
		int max = 0;
		for(int i = 0; i < l; i++){
			char c = a.charAt(i);
			if(c=='o'){
				chain++;
			}else{
				max = Math.max(max,chain);
				chain = 0;
			}
		}
		max = Math.max(max,chain);
		sb.append(max);
		System.out.println(sb);
	}
}
0