結果
問題 |
No.1469 programing
|
ユーザー |
![]() |
提出日時 | 2021-04-03 13:36:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 2,681 ms / 3,000 ms |
コード長 | 540 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 20,188 KB |
最終ジャッジ日時 | 2024-12-24 18:22:03 |
合計ジャッジ時間 | 5,435 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
#変更後assert def main(): S=input() assert(1<=len(S)<=5*(10**6)) #英小文字かどうか 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()