結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー k_kadorak_kadora
提出日時 2015-06-10 20:19:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 505 bytes
コンパイル時間 3,276 ms
コンパイル使用メモリ 72,356 KB
実行使用メモリ 56,092 KB
最終ジャッジ日時 2023-08-11 15:47:26
合計ジャッジ時間 8,120 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,748 KB
testcase_01 AC 119 ms
53,652 KB
testcase_02 AC 119 ms
55,620 KB
testcase_03 AC 120 ms
55,448 KB
testcase_04 AC 120 ms
55,256 KB
testcase_05 AC 119 ms
55,556 KB
testcase_06 AC 118 ms
55,640 KB
testcase_07 AC 119 ms
56,092 KB
testcase_08 AC 119 ms
55,504 KB
testcase_09 AC 120 ms
55,712 KB
testcase_10 AC 118 ms
55,616 KB
testcase_11 AC 123 ms
55,392 KB
testcase_12 AC 120 ms
55,392 KB
testcase_13 AC 119 ms
55,444 KB
testcase_14 AC 119 ms
55,688 KB
testcase_15 AC 119 ms
55,608 KB
testcase_16 AC 118 ms
55,520 KB
testcase_17 AC 119 ms
55,768 KB
testcase_18 AC 119 ms
55,652 KB
testcase_19 AC 120 ms
55,640 KB
testcase_20 AC 119 ms
55,456 KB
testcase_21 AC 119 ms
55,368 KB
testcase_22 AC 120 ms
55,668 KB
testcase_23 AC 120 ms
55,684 KB
testcase_24 AC 119 ms
55,408 KB
testcase_25 AC 120 ms
55,580 KB
testcase_26 AC 117 ms
55,756 KB
testcase_27 AC 120 ms
55,596 KB
testcase_28 AC 119 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Gw{
	public static void main(String[] arg){
		String w1,w2;
		int temp=0,res = 0;
		Scanner sc = new Scanner(System.in);
		w1 = sc.next();
		w2 = sc.next();
		for(int i=0;i<7;i++){
			if(w1.charAt(i) == 'o'){
				temp++;
			}else{
				if(res < temp)res = temp;
				temp = 0;
			}
		}
		for(int i=0;i<7;i++){
			if(w2.charAt(i) == 'o'){
				temp++;
			}else{
				if(res<temp)res = temp;
				temp = 0;
			}
		}
		if(res<temp)res = temp;
		System.out.println(res);
	}
}
0