結果
問題 |
No.1469 programing
|
ユーザー |
![]() |
提出日時 | 2021-04-03 01:25:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,091 ms / 3,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 20,312 KB |
最終ジャッジ日時 | 2024-12-24 18:18:56 |
合計ジャッジ時間 | 3,436 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
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()