結果
| 問題 | 
                            No.342 一番ワロタww
                             | 
                    
| コンテスト | |
| ユーザー | 
                             🍡yurahuna
                         | 
                    
| 提出日時 | 2016-02-12 23:09:16 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 877 bytes | 
| コンパイル時間 | 86 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-22 04:52:25 | 
| 合計ジャッジ時間 | 1,223 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 WA * 2 | 
ソースコード
# -*- coding: utf-8 -*-
s = input()
n = len(s)
if s.count('w') == n:
    print('')
    exit()
li = [0] * n
ma = 0
flag = False
cnt = 0
for i in range(n):
    if flag and s[i] == 'w':
        cnt += 1
    elif not flag and s[i] == 'w':
        flag = True
        cnt += 1
    elif flag and s[i] != 'w':
        flag = False
        ma = max(ma, cnt)
        li[i-1] = cnt
        cnt = 0
ma = max(ma, cnt)
li[n-1] = cnt
li.reverse()
s = s[::-1]
ans = []
t = ''
flag = False
i = 0
while i < n:
    if flag and s[i] != 'w':
        t += s[i]
        i += 1
        continue
    if flag and s[i] == 'w':
        flag = False
        ans.append(t)
        t = ''
    if li[i] == ma:
        flag = True
        i += ma
        continue
    i += 1
if t != '':
    ans.append(t)
if ans != []:
    for x in ans[::-1]:
        print(x[::-1])
else:
    print('')
            
            
            
        
            
🍡yurahuna