結果
問題 | No.342 一番ワロタww |
ユーザー |
![]() |
提出日時 | 2020-04-03 18:42:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 633 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-03 01:07:36 |
合計ジャッジ時間 | 1,113 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = readline().decode().strip() while S.startswith('w'): S = S[1:] cans = [] is_w = False t = "" for s in S: if s == 'w': is_w = True elif is_w and s != 'w': cans.append(t) is_w = False t = "" t += s cans.append(t) res = [] for can in cans: cnt = can.count('w') res.append([cnt, can.replace('w', '')]) res.sort(key=lambda x: int(x[0])) x = res[-1][0] if x == 0: print() else: for r in res: if r[0] == x: print(r[1])