結果

問題 No.1198 お菓子配り-1
ユーザー uni_pythonuni_python
提出日時 2020-08-28 21:23:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 137,980 KB
最終ジャッジ日時 2023-08-08 20:08:05
合計ジャッジ時間 4,195 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
108,608 KB
testcase_01 AC 137 ms
108,844 KB
testcase_02 AC 136 ms
108,756 KB
testcase_03 AC 138 ms
108,796 KB
testcase_04 AC 135 ms
108,592 KB
testcase_05 AC 139 ms
108,880 KB
testcase_06 AC 133 ms
108,756 KB
testcase_07 AC 134 ms
108,472 KB
testcase_08 AC 137 ms
108,648 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 177 ms
137,980 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 129 ms
108,716 KB
testcase_17 AC 130 ms
108,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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**5+2
    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()
0