結果

問題 No.342 一番ワロタww
ユーザー takakintakakin
提出日時 2020-06-29 22:11:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 414 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 7,912 KB
最終ジャッジ日時 2023-09-26 11:21:55
合計ジャッジ時間 1,252 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,912 KB
testcase_01 AC 15 ms
7,848 KB
testcase_02 AC 15 ms
7,812 KB
testcase_03 AC 16 ms
7,804 KB
testcase_04 AC 15 ms
7,776 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,840 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 15 ms
7,852 KB
testcase_09 AC 15 ms
7,804 KB
testcase_10 AC 15 ms
7,820 KB
testcase_11 AC 15 ms
7,784 KB
testcase_12 AC 15 ms
7,780 KB
testcase_13 AC 16 ms
7,820 KB
testcase_14 AC 15 ms
7,856 KB
testcase_15 AC 15 ms
7,828 KB
testcase_16 AC 15 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

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