結果

問題 No.1469 programing
ユーザー harurun
提出日時 2021-04-03 01:28:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 555 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 325,724 KB
最終ジャッジ日時 2024-12-24 18:19:42
合計ジャッジ時間 23,339 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  S=input()
  assert(0<=len(S)<=5*(10**6))
  if len(S)!=0:
    #英小文字かどうか
    for i in S:
      assert(ord("a")<=ord(i)<=ord("z"))
    if len(S)>2:
      #3文字以上続いてないか(3文字続いているかの確認で3文字以上も確認できる)
      for i in range(len(S)-2):
        if S[i]==S[i+1] and S[i+1]==S[i+2]:
          raise Exception("3 or more continues.")
  if len(S)<2:
    print(S)
    return
  ans=S[0]
  for i in range(1,len(S)):
    if S[i-1]!=S[i]:
      ans+=S[i]
  print(ans)
  return

main()
0