結果
| 問題 |
No.632 穴埋め門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-01 13:15:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 1,000 ms |
| コード長 | 657 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,648 KB |
| 最終ジャッジ日時 | 2024-07-16 06:29:00 |
| 合計ジャッジ時間 | 1,232 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
from typing import Sequence
def is_kadomatsu(height_seq: Sequence[int]) -> bool:
if len(set(height_seq)) != 3:
return False
if max(height_seq) == height_seq[1] or min(height_seq) == height_seq[1]:
return True
return False
def main():
c = list(input().split())
question_idx = c.index("?")
c_1 = c.copy()
c_1[question_idx] = 1
c_2 = c.copy()
c_2[question_idx] = 4
c_1 = list(map(int, c_1))
c_2 = list(map(int, c_2))
if is_kadomatsu(c_1):
if is_kadomatsu(c_2):
print(14)
else:
print(1)
else:
print(4)
if __name__ == "__main__":
main()