結果
| 問題 |
No.2535 多重同値
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-11-11 00:23:15 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 470 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 48,164 KB |
| 最終ジャッジ日時 | 2024-09-26 02:29:50 |
| 合計ジャッジ時間 | 2,726 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 11 |
ソースコード
import sys
sys.setrecursionlimit(10**7)
from functools import lru_cache
@lru_cache(maxsize=None)
def calc(i,x):
if i==0:
return S[x]
elif i==1:
return x
else:
if S[i-1]==x:
return calc(i-1,"Yes")
else:
return calc(i-1,"No")
N=int(input())
S=[input().strip() for i in range(N)]
print(S[0])
for i in range(1,N):
if S[i]==S[i-1]:
print(calc(i,"Yes"))
else:
print(calc(i,"No"))
titia