結果

問題 No.1469 programing
ユーザー harurunharurun
提出日時 2021-04-03 01:28:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 555 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 273,284 KB
最終ジャッジ日時 2023-08-26 04:17:15
合計ジャッジ時間 8,013 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
78,492 KB
testcase_01 AC 72 ms
71,312 KB
testcase_02 AC 72 ms
71,336 KB
testcase_03 AC 72 ms
71,296 KB
testcase_04 AC 73 ms
71,468 KB
testcase_05 AC 106 ms
75,836 KB
testcase_06 AC 78 ms
75,884 KB
testcase_07 AC 82 ms
76,120 KB
testcase_08 AC 308 ms
81,156 KB
testcase_09 AC 450 ms
87,872 KB
testcase_10 AC 456 ms
85,280 KB
testcase_11 TLE -
testcase_12 AC 1,652 ms
260,240 KB
testcase_13 AC 72 ms
71,380 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

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