結果
問題 |
No.342 一番ワロタww
|
ユーザー |
|
提出日時 | 2016-02-12 23:24:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 638 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-15 13:13:21 |
合計ジャッジ時間 | 1,242 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
s=input() head=0 while head<len(s) and s[head]=='w': head+=1 s=s[head:] #最長のwを探す M=0 for i in range(len(s)): if s[i]=='w': j=i while j<len(s) and s[j]=='w': j+=1 M=max(M,j-i) ans=[] for i in range(len(s)): if s[i]=='w': j=i while j<len(s) and s[j]=='w': j+=1 #最長なのでここの文字列を探しに行く if j-i==M: st=i-1 while st>=0 and s[st]!='w': st-=1 #print("st=",st) ans.append(s[st+1:i]) for v in ans: if len(v)>0: print(v)