結果

問題 No.342 一番ワロタww
コンテスト
ユーザー tanimani364
提出日時 2021-03-21 18:08:56
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 97 ms / 5,000 ms
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 373 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-05-16 14:13:05
合計ジャッジ時間 2,964 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3
#coding:utf-8
from __future__ import unicode_literals
import math
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt



def main():
	read=stdin.readline

	#edit here!
	s=read()

	cnt=0
	maxv=0
	x=""
	ans=[]
	for i in s:
		if i=='w':
			cnt+=1
		else:
			if x!="" and maxv < cnt:
				
				maxv=cnt
				ans=[]
				ans.append(x)
			elif cnt>0 and maxv==cnt:
				ans.append(x)
			
			if cnt==0:
				x+=i
			else:
				x=i
			cnt=0

	for i in ans:
		print(i)
if __name__ == '__main__':
    main()
0