結果
問題 | No.358 も~っと!門松列 |
ユーザー |
|
提出日時 | 2016-10-10 20:22:38 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 29 ms / 1,000 ms |
コード長 | 439 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 8,192 KB |
最終ジャッジ日時 | 2024-11-22 01:02:09 |
合計ジャッジ時間 | 1,780 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll def is_kadomatsu(a, b, c): return a != b and b != c and c != a and (max((a, b, c)) == b or min((a, b, c)) == b) A1, A2, A3 = map(int, raw_input().split()) ans = 0 for p in xrange(1, 1005): B1, B2, B3 = A1%p, A2%p, A3%p if is_kadomatsu(B1, B2, B3): ans += 1 print ans if not is_kadomatsu(A1, A2, A3) else "INF"