結果
問題 | No.342 一番ワロタww |
ユーザー |
![]() |
提出日時 | 2016-02-12 23:35:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 940 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 107,612 KB |
最終ジャッジ日時 | 2024-09-22 05:00:35 |
合計ジャッジ時間 | 12,453 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 13 |
ソースコード
# -*- coding: utf-8 -*-s = input()n = len(s)if s.count('w') in [0, n]:print('')exit()li = [0] * nma = 0flag = Falsecnt = 0i = 0while i < n and s[i] == 'w':i += 1while i < n:if flag and s[i] == 'w':cnt += 1elif not flag and s[i] == 'w':flag = Truecnt += 1elif flag and s[i] != 'w':flag = Falsema = max(ma, cnt)li[i-1] = cntcnt = 0i += 1ma = max(ma, cnt)li[n-1] = cntli.reverse()s = s[::-1]ans = []t = ''flag = Falsei = 0while i < n:if flag and s[i] != 'w':t += s[i]i += 1continueif flag and s[i] == 'w':flag = Falseans.append(t)t = ''if li[i] == ma:flag = Truei += macontinuei += 1if t != '':ans.append(t)if ans != []:for x in ans[::-1]:print(x[::-1])else:print('')