結果
問題 |
No.1469 programing
|
ユーザー |
![]() |
提出日時 | 2021-04-03 01:13:55 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 555 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 20,184 KB |
最終ジャッジ日時 | 2024-12-24 18:18:12 |
合計ジャッジ時間 | 3,635 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 RE * 2 |
ソースコード
def main(): S=input() assert(0<=len(S)<=3*(10**5)) 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()