結果
問題 | No.342 一番ワロタww |
ユーザー | kekenx |
提出日時 | 2020-04-03 18:42:29 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 17 ms / 5,000 ms |
コード長 | 633 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 10,868 KB |
実行使用メモリ | 7,888 KB |
最終ジャッジ日時 | 2023-09-15 23:57:54 |
合計ジャッジ時間 | 1,255 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
7,768 KB |
testcase_01 | AC | 16 ms
7,880 KB |
testcase_02 | AC | 17 ms
7,792 KB |
testcase_03 | AC | 16 ms
7,888 KB |
testcase_04 | AC | 16 ms
7,784 KB |
testcase_05 | AC | 16 ms
7,808 KB |
testcase_06 | AC | 16 ms
7,808 KB |
testcase_07 | AC | 16 ms
7,852 KB |
testcase_08 | AC | 16 ms
7,736 KB |
testcase_09 | AC | 16 ms
7,884 KB |
testcase_10 | AC | 17 ms
7,840 KB |
testcase_11 | AC | 16 ms
7,744 KB |
testcase_12 | AC | 17 ms
7,856 KB |
testcase_13 | AC | 16 ms
7,764 KB |
testcase_14 | AC | 15 ms
7,820 KB |
testcase_15 | AC | 16 ms
7,880 KB |
testcase_16 | AC | 16 ms
7,840 KB |
ソースコード
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])