結果
| 問題 | No.358 も~っと!門松列 |
| コンテスト | |
| ユーザー |
shiccocsan
|
| 提出日時 | 2016-12-06 08:34:27 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 23 ms / 1,000 ms |
| + 883µs | |
| コード長 | 433 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2026-10-01 04:29:19 |
| 合計ジャッジ時間 | 2,338 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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