結果

問題 No.1469 programing
ユーザー mesame3993mesame3993
提出日時 2021-11-15 00:54:11
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 368 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 264,576 KB
最終ジャッジ日時 2024-05-07 17:32:13
合計ジャッジ時間 7,424 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,920 KB
testcase_01 AC 36 ms
51,712 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 37 ms
51,840 KB
testcase_04 AC 36 ms
51,968 KB
testcase_05 AC 42 ms
59,776 KB
testcase_06 AC 40 ms
58,240 KB
testcase_07 AC 43 ms
59,776 KB
testcase_08 AC 294 ms
84,224 KB
testcase_09 AC 496 ms
97,468 KB
testcase_10 AC 400 ms
92,800 KB
testcase_11 TLE -
testcase_12 AC 1,790 ms
259,328 KB
testcase_13 AC 39 ms
51,584 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  input=stdin.readline
  s = input()[:-1]
  n = len(s)
  ans = ''
  flag = False
  for i in range(n-1):
    if flag:
      flag = False
      continue
    if s[i] == s[i+1]:
      ans += s[i]
      flag = True
    else:
      ans += s[i]
  if n == 1:
    ans = s
  else:
    if s[-1] != s[-2]:
      ans += s[-1]
  print(ans)
main()
0