結果
問題 |
No.342 一番ワロタww
|
ユーザー |
![]() |
提出日時 | 2024-07-17 02:03:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 5,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 81,456 KB |
実行使用メモリ | 64,044 KB |
最終ジャッジ日時 | 2024-07-17 02:03:32 |
合計ジャッジ時間 | 1,746 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
import re S = input() w = 'w' reg = re.compile('^[^w]*w+') s = S cands = [] while m := reg.match(s): t = m.group(0) if t[0] != w: cands.append((t, t.count(w))) s = s[len(t):] if not cands: print() exit() _, max_wcnt = max(cands, key=lambda x: x[1]) for s, wcnt in cands: if wcnt == max_wcnt: print(s[:-wcnt])