結果
問題 | No.341 沈黙の期間 |
ユーザー |
![]() |
提出日時 | 2017-06-21 19:29:17 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 537 bytes |
コンパイル時間 | 2,307 ms |
コンパイル使用メモリ | 77,016 KB |
実行使用メモリ | 56,740 KB |
最終ジャッジ日時 | 2024-10-02 10:58:05 |
合計ジャッジ時間 | 5,232 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 1 WA * 10 |
ソースコード
import java.util.*; import java.util.regex.Pattern; import java.util.regex.Matcher; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); int ans = 0; for(int i = 33; i > 0; i--) { String regex = ""; for(int j = 0; j < 3 * i; j++) { regex += "\\."; } Pattern p = Pattern.compile(regex); Matcher m = p.matcher(S); if(m.find()) { ans = i; break; } } System.out.println(ans); } }