結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
![]() |
提出日時 | 2020-08-28 21:25:04 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 466 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 355,028 KB |
最終ジャッジ日時 | 2024-11-13 23:47:55 |
合計ジャッジ時間 | 15,426 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 WA * 4 |
ソースコード
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() from collections import defaultdict dd = defaultdict(int) M=10**6 for i in range(1,M): dd[i*i]+=1 flag=0 for i in range(1,M): aa=i*i bb=aa-N if dd[bb]: flag=1 if flag: print(1) else: print(-1) main()