結果

問題 No.648  お や す み 
ユーザー 👑 KazunKazun
提出日時 2020-06-10 04:15:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 669 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 80,104 KB
最終ジャッジ日時 2023-09-02 13:35:27
合計ジャッジ時間 14,287 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
72,000 KB
testcase_01 AC 71 ms
71,568 KB
testcase_02 AC 71 ms
71,848 KB
testcase_03 AC 72 ms
71,576 KB
testcase_04 AC 69 ms
71,760 KB
testcase_05 AC 69 ms
71,940 KB
testcase_06 AC 71 ms
71,632 KB
testcase_07 AC 71 ms
71,628 KB
testcase_08 AC 70 ms
71,820 KB
testcase_09 AC 70 ms
71,812 KB
testcase_10 AC 72 ms
71,812 KB
testcase_11 AC 72 ms
71,864 KB
testcase_12 AC 70 ms
71,708 KB
testcase_13 AC 72 ms
71,612 KB
testcase_14 AC 71 ms
71,952 KB
testcase_15 AC 70 ms
71,652 KB
testcase_16 AC 71 ms
71,924 KB
testcase_17 AC 69 ms
71,620 KB
testcase_18 AC 70 ms
71,572 KB
testcase_19 AC 70 ms
71,408 KB
testcase_20 AC 73 ms
75,880 KB
testcase_21 AC 72 ms
76,068 KB
testcase_22 AC 71 ms
75,760 KB
testcase_23 AC 73 ms
75,856 KB
testcase_24 AC 72 ms
75,572 KB
testcase_25 AC 72 ms
75,964 KB
testcase_26 AC 72 ms
75,788 KB
testcase_27 AC 72 ms
75,624 KB
testcase_28 AC 75 ms
75,960 KB
testcase_29 AC 75 ms
75,660 KB
testcase_30 AC 74 ms
75,696 KB
testcase_31 AC 74 ms
75,692 KB
testcase_32 AC 73 ms
75,816 KB
testcase_33 AC 73 ms
75,736 KB
testcase_34 AC 73 ms
75,744 KB
testcase_35 AC 73 ms
75,888 KB
testcase_36 AC 73 ms
75,444 KB
testcase_37 AC 75 ms
75,788 KB
testcase_38 AC 75 ms
75,700 KB
testcase_39 AC 74 ms
76,148 KB
testcase_40 AC 74 ms
75,568 KB
testcase_41 AC 73 ms
75,700 KB
testcase_42 AC 74 ms
75,664 KB
testcase_43 AC 74 ms
75,784 KB
testcase_44 AC 74 ms
75,744 KB
testcase_45 AC 75 ms
75,584 KB
testcase_46 AC 73 ms
75,852 KB
testcase_47 AC 73 ms
75,568 KB
testcase_48 AC 74 ms
75,888 KB
testcase_49 AC 73 ms
75,740 KB
testcase_50 AC 370 ms
75,584 KB
testcase_51 AC 278 ms
76,072 KB
testcase_52 AC 370 ms
75,740 KB
testcase_53 AC 507 ms
75,620 KB
testcase_54 AC 677 ms
75,536 KB
testcase_55 AC 390 ms
75,600 KB
testcase_56 AC 488 ms
75,736 KB
testcase_57 AC 529 ms
75,584 KB
testcase_58 AC 478 ms
75,500 KB
testcase_59 AC 138 ms
75,392 KB
testcase_60 TLE -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#素因数分解
def Prime_Factorization(n):
    R=[]
    N=n

    for k in range(2,int(-(-n**0.5//1))+1):
        if N%k==0:
            C=0
            while N%k==0:
                C+=1
                N//=k
            R.append([k,C])

    if N!=1:
        R.append([N,1])
        
    if not R:
        R.append([N,1])

    return R

#平方数?
def Is_Square_Number(N):
    H=Prime_Factorization(N)

    for (_,x) in H:
        if x%2:
            return False
    return True

n=int(input())
if Is_Square_Number(8*n+1):
    H=Prime_Factorization(8*n+1)

    s=1
    for (c,k) in H:
        s*=c**(k//2)
    print("YES")
    print((s-1)//2)
else:
    print("NO")
0