結果
問題 | No.341 沈黙の期間 |
ユーザー | めうめう🎒 |
提出日時 | 2016-05-07 20:59:27 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 556 bytes |
コンパイル時間 | 2,107 ms |
コンパイル使用メモリ | 74,432 KB |
実行使用メモリ | 54,436 KB |
最終ジャッジ日時 | 2024-04-15 13:40:12 |
合計ジャッジ時間 | 4,624 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
54,096 KB |
testcase_01 | AC | 131 ms
54,232 KB |
testcase_02 | WA | - |
testcase_03 | AC | 128 ms
53,832 KB |
testcase_04 | AC | 125 ms
54,256 KB |
testcase_05 | AC | 126 ms
54,112 KB |
testcase_06 | AC | 123 ms
54,304 KB |
testcase_07 | AC | 124 ms
54,136 KB |
testcase_08 | AC | 127 ms
54,116 KB |
testcase_09 | AC | 127 ms
54,240 KB |
testcase_10 | AC | 128 ms
53,952 KB |
testcase_11 | AC | 131 ms
54,108 KB |
testcase_12 | WA | - |
testcase_13 | AC | 125 ms
54,112 KB |
ソースコード
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(); } }