結果
問題 | No.203 ゴールデン・ウィーク(1) |
ユーザー |
![]() |
提出日時 | 2015-05-08 22:25:06 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 60 ms / 1,000 ms |
コード長 | 861 bytes |
コンパイル時間 | 3,365 ms |
コンパイル使用メモリ | 80,120 KB |
実行使用メモリ | 37,444 KB |
最終ジャッジ日時 | 2024-11-18 08:57:44 |
合計ジャッジ時間 | 5,989 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class NO203 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); String S = br.readLine(); S += br.readLine(); int sLen = S.length(); int count = 0; int max = 0; for (int i = 0; i < sLen; i++) { if(S.substring(i, i+1).equals("o")){ count++; }else{ max = Math.max(max, count); count = 0; } } max = Math.max(max, count); System.out.println(max); } catch (Exception e) { System.err.println("Error:" + e.getMessage()); } } }