結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
|
提出日時 | 2015-08-07 20:24:19 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 688 bytes |
コンパイル時間 | 4,078 ms |
コンパイル使用メモリ | 76,608 KB |
実行使用メモリ | 41,588 KB |
最終ジャッジ日時 | 2024-07-18 05:02:28 |
合計ジャッジ時間 | 7,658 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 5 |
ソースコード
import java.util.*; public class gw{ public static void main(String... args){ Scanner scan = new Scanner(System.in); String str1 = scan.next(); String str2 = scan.next(); System.out.println(calc(str1+str2)); } public static int calc(String str){ int[] counter = new int[14]; for(int i = 0; i < counter.length;i++){ counter[i] = 0; } int count = 0; int space = 0; for(int i = 0; i < str.length(); i++){ if(str.substring(i,i+1).equals("o")){ count++; }else{ counter[space] = count; count=0; space++; } } int max = counter[0]; for(int i = 1; i < space; i++){ if(max < counter[i]){ max = counter[i]; } } return max; } }