結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-18 01:30:03 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 5,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-04 12:52:21 |
| 合計ジャッジ時間 | 815 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU
function isKadomatsuRetsu(b1, b2, b3)
return b1 ~= b3 and ((b2 < b1 and b2 < b3) or (b2 > b1 and b2 > b3))
end
gi = io.read():gmatch('%d+')
a1 = tonumber(gi())
a2 = tonumber(gi())
a3 = tonumber(gi())
if isKadomatsuRetsu(a1, a2, a3) then
print('INF')
else
c = 0
for p = 1, math.max(a1, a2, a3) do
if isKadomatsuRetsu(a1 % p, a2 % p, a3 % p) then
c = c + 1
end
end
print(c)
end