結果

問題 No.1198 お菓子配り-1
ユーザー uni_pythonuni_python
提出日時 2020-08-28 21:25:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 1,110 ms
コンパイル使用メモリ 86,392 KB
実行使用メモリ 358,276 KB
最終ジャッジ日時 2023-08-08 20:09:17
合計ジャッジ時間 18,109 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 659 ms
259,288 KB
testcase_01 AC 711 ms
259,288 KB
testcase_02 AC 672 ms
259,412 KB
testcase_03 AC 632 ms
259,312 KB
testcase_04 AC 652 ms
259,324 KB
testcase_05 AC 672 ms
259,432 KB
testcase_06 AC 688 ms
259,288 KB
testcase_07 AC 668 ms
259,436 KB
testcase_08 AC 646 ms
259,304 KB
testcase_09 AC 660 ms
259,588 KB
testcase_10 AC 654 ms
259,496 KB
testcase_11 WA -
testcase_12 AC 1,376 ms
358,096 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 675 ms
259,460 KB
testcase_17 AC 639 ms
259,336 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**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()
0