結果
問題 |
No.1643 Not Substring
|
ユーザー |
|
提出日時 | 2021-08-13 21:24:48 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 789 bytes |
コンパイル時間 | 349 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 62,764 KB |
最終ジャッジ日時 | 2024-10-03 21:16:03 |
合計ジャッジ時間 | 2,570 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 WA * 17 |
ソースコード
# import sys # #sys.setrecursionlimit(1000000) # input = sys.stdin.readline def mp():return map(int,input().split()) def lmp():return list(map(int,input().split())) import math import bisect from copy import deepcopy as dc from itertools import accumulate from collections import Counter, defaultdict, deque import itertools def ceil(U,V):return (U+V-1)//V def modf1(N,MOD):return (N-1)%MOD+1 inf = int(1e30) mod = int(1e9+7) def rle(lst): ans = [] cnt = 1 ini = lst[0] for i in range(1, len(lst)): if ini == lst[i]:cnt += 1 else: ans.append((ini, cnt)) cnt = 1 ini = lst[i] ans.append((ini, cnt)) return ans s = list(input()) r = rle(s) cnt = 0 for i,j in r: if i == "a":cnt = max(cnt,j) print("a"*cnt+"a")