結果
| 問題 | No.342 一番ワロタww |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2024-07-17 01:38:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 5,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 81,580 KB |
| 実行使用メモリ | 53,628 KB |
| 最終ジャッジ日時 | 2024-07-17 01:38:05 |
| 合計ジャッジ時間 | 1,966 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
S = input()
w = 'w'
while S and S[0] == w:
S = S[1:]
max_wcnt = 0
cands = []
p = 0
while (q := S.find(w, p)) != -1:
i = q
while i < len(S) and S[i] == w:
i += 1
if i-q > max_wcnt:
max_wcnt = i-q
cands.clear()
if i-q == max_wcnt:
cands.append(q)
p = i
for i in cands:
p = i-1
res = []
while p >= 0 and S[p] != w:
res.append(S[p])
p -= 1
print(''.join(reversed(res)))
norioc