結果
問題 |
No.341 沈黙の期間
|
ユーザー |
![]() |
提出日時 | 2017-05-05 09:29:17 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 68 ms / 5,000 ms |
コード長 | 769 bytes |
コンパイル時間 | 2,210 ms |
コンパイル使用メモリ | 76,484 KB |
実行使用メモリ | 50,928 KB |
最終ジャッジ日時 | 2024-09-14 08:35:15 |
合計ジャッジ時間 | 4,002 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String S = reader.readLine(); int[] table = new int[S.length()]; for (int i = 0; i < S.length(); i++) { if (S.charAt(i) == '…') { table[i] = 1; } } for (int i = 1; i < S.length(); i++) { if(table[i] != 0) { table[i] = table[i] + table[i - 1]; } } System.out.println(Arrays.stream(table).max().getAsInt()); } }