結果
問題 | No.1469 programing |
ユーザー | harurun |
提出日時 | 2021-04-03 01:19:26 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 10,992 KB |
実行使用メモリ | 17,920 KB |
最終ジャッジ日時 | 2023-08-26 04:17:32 |
合計ジャッジ時間 | 2,385 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 14 ms
7,808 KB |
testcase_01 | AC | 14 ms
7,820 KB |
testcase_02 | AC | 16 ms
7,796 KB |
testcase_03 | AC | 15 ms
7,936 KB |
testcase_04 | AC | 14 ms
7,824 KB |
testcase_05 | AC | 16 ms
7,824 KB |
testcase_06 | AC | 15 ms
7,756 KB |
testcase_07 | AC | 16 ms
7,820 KB |
testcase_08 | AC | 58 ms
8,256 KB |
testcase_09 | AC | 73 ms
8,292 KB |
testcase_10 | AC | 68 ms
8,312 KB |
testcase_11 | AC | 107 ms
8,692 KB |
testcase_12 | AC | 83 ms
8,376 KB |
testcase_13 | AC | 14 ms
7,788 KB |
testcase_14 | AC | 136 ms
8,752 KB |
testcase_15 | AC | 138 ms
8,644 KB |
testcase_16 | AC | 220 ms
8,932 KB |
testcase_17 | RE | - |
ソースコード
def main(): S=input() assert(0<=len(S)<=(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()