結果

問題 No.342 一番ワロタww
ユーザー takakin
提出日時 2020-06-29 22:11:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 414 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-07-19 06:01:23
合計ジャッジ時間 1,129 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
S=input()
while True:
  if S and S[0]=="w":
    S=S[1:]
  else:
    break
A=[]
B=[]
cur=""
ct=0
for s in S:
  if s=="w" and ct==0:
    A.append(cur)
    cur=""
    ct=1
  elif s=="w":
    ct+=1
  elif ct!=0:
    B.append(ct)
    cur+=s
    ct=0
  else:
    cur+=s
    ct=0
B.append(ct)

n=len(A)
m=max(B)
for i in range(n):
  if B[i]==m:
    print(A[i])
0