結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー k_kadorak_kadora
提出日時 2015-06-10 20:19:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 505 bytes
コンパイル時間 3,411 ms
コンパイル使用メモリ 74,560 KB
実行使用メモリ 41,184 KB
最終ジャッジ日時 2024-04-29 07:48:49
合計ジャッジ時間 8,168 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
40,824 KB
testcase_01 AC 108 ms
40,064 KB
testcase_02 AC 121 ms
40,900 KB
testcase_03 AC 125 ms
41,168 KB
testcase_04 AC 114 ms
40,356 KB
testcase_05 AC 122 ms
40,960 KB
testcase_06 AC 123 ms
41,040 KB
testcase_07 AC 122 ms
40,908 KB
testcase_08 AC 123 ms
41,120 KB
testcase_09 AC 123 ms
41,020 KB
testcase_10 AC 109 ms
39,924 KB
testcase_11 AC 109 ms
39,796 KB
testcase_12 AC 124 ms
41,060 KB
testcase_13 AC 125 ms
41,176 KB
testcase_14 AC 121 ms
40,800 KB
testcase_15 AC 114 ms
40,376 KB
testcase_16 AC 110 ms
40,116 KB
testcase_17 AC 108 ms
40,244 KB
testcase_18 AC 123 ms
41,016 KB
testcase_19 AC 129 ms
41,040 KB
testcase_20 AC 122 ms
40,792 KB
testcase_21 AC 121 ms
40,908 KB
testcase_22 AC 108 ms
39,868 KB
testcase_23 AC 123 ms
41,040 KB
testcase_24 AC 120 ms
41,128 KB
testcase_25 AC 119 ms
40,960 KB
testcase_26 AC 124 ms
41,096 KB
testcase_27 AC 122 ms
41,184 KB
testcase_28 AC 120 ms
40,920 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