結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
shiccocsan
|
| 提出日時 | 2016-12-06 08:34:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| コード長 | 433 bytes |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-28 01:37:59 |
| 合計ジャッジ時間 | 1,601 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
is_kadomatsu = lambda x: (max(x) == x[1] or min(x) == x[1]) and not is_zero(x)
is_zero = lambda x: x[0] == x[-1] or x[0] == x[1] or x[1] == x[-1]
an = list(map(int, input().split()))
if is_zero(an):
print(0)
elif is_kadomatsu(an):
print('INF')
else:
cnt = 0
for b in [list(map(lambda y: y % i, an)) for i in range(2, max(an) + 1)]:
# print(b)
if is_kadomatsu(b):
cnt += 1
print(cnt)
shiccocsan