結果

問題 No.341 沈黙の期間
コンテスト
ユーザー takeya_okino
提出日時 2017-06-21 19:29:17
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
WA  
実行時間 -
コード長 537 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,552 ms
コンパイル使用メモリ 89,512 KB
実行使用メモリ 45,912 KB
最終ジャッジ日時 2026-09-08 21:39:11
合計ジャッジ時間 3,718 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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);
  }
}
0