結果
| 問題 |
No.2614 Delete ABC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-26 21:40:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 559 bytes |
| コンパイル時間 | 367 ms |
| コンパイル使用メモリ | 82,388 KB |
| 実行使用メモリ | 53,568 KB |
| 最終ジャッジ日時 | 2024-09-28 07:53:46 |
| 合計ジャッジ時間 | 857 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 2 |
ソースコード
def check_conditions(S):
if not set(S).issubset({'A', 'B', 'C'}):
return False
while 'ABC' in S:
S = S.replace('ABC', '')
if S != '':
return False
S = 'ABC' * N
while 'A' in S and 'B' in S and 'C' in S:
S = S.replace('A', '', 1)
S = S.replace('B', '', 1)
S = S.replace('C', '', 1)
if S != '':
return False
if 'AA' in S or 'BB' in S or 'CC' in S:
return False
return True
T = int(input())
for _ in range(T):
N = int(input())
S = 'ABC' * N
print(S)