結果
| 問題 | No.1198 お菓子配り-1 |
| コンテスト | |
| ユーザー |
uni_python
|
| 提出日時 | 2020-08-28 21:32:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 774 bytes |
| 記録 | |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 116,712 KB |
| 最終ジャッジ日時 | 2024-11-13 23:51:24 |
| 合計ジャッジ時間 | 16,485 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 TLE * 5 |
ソースコード
import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def main():
mod=10**9+7
N=I()
#約数列挙
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
d=make_divisors(N)
flag=0
for i in range(len(d)):
a=d[i]
b=d[-1-i]
if b<=a:
break
if (b-a)%2==0:
flag=1
break
if flag:
print(1)
else:
print(-1)
main()
uni_python