結果
問題 | No.341 沈黙の期間 |
ユーザー |
![]() |
提出日時 | 2016-05-07 20:59:27 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 556 bytes |
コンパイル時間 | 1,765 ms |
コンパイル使用メモリ | 73,752 KB |
実行使用メモリ | 41,284 KB |
最終ジャッジ日時 | 2024-10-05 10:25:49 |
合計ジャッジ時間 | 3,772 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 10 WA * 1 |
ソースコード
import java.util.Scanner; public class Main { private String str; public void setStr(String str){ this.str = str; } public String getStr(){ return str; } public void countNum(){ int num = 0,ans = 0; for(int i = 0;i < this.str.length();i++){ if(str.substring(i,i + 1).equals("…")) { num++; }else{ ans = Math.max(num,ans); num = 0; } } System.out.println(ans); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); Main m = new Main(); m.setStr(sc.next()); m.countNum(); } }