結果

問題 No.634 硬貨の枚数1
ユーザー mkawa2mkawa2
提出日時 2020-01-06 23:09:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 8,464 KB
最終ジャッジ日時 2023-08-14 22:56:28
合計ジャッジ時間 53,114 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 660 ms
8,224 KB
testcase_01 WA -
testcase_02 AC 661 ms
8,244 KB
testcase_03 AC 657 ms
8,284 KB
testcase_04 AC 660 ms
8,264 KB
testcase_05 AC 658 ms
8,372 KB
testcase_06 AC 661 ms
8,284 KB
testcase_07 AC 660 ms
8,336 KB
testcase_08 AC 659 ms
8,292 KB
testcase_09 AC 656 ms
8,272 KB
testcase_10 AC 661 ms
8,448 KB
testcase_11 AC 662 ms
8,344 KB
testcase_12 AC 657 ms
8,236 KB
testcase_13 AC 662 ms
8,268 KB
testcase_14 AC 660 ms
8,412 KB
testcase_15 AC 661 ms
8,264 KB
testcase_16 AC 661 ms
8,208 KB
testcase_17 AC 659 ms
8,260 KB
testcase_18 AC 657 ms
8,420 KB
testcase_19 AC 179 ms
8,292 KB
testcase_20 AC 105 ms
8,432 KB
testcase_21 AC 661 ms
8,356 KB
testcase_22 AC 661 ms
8,228 KB
testcase_23 AC 660 ms
8,352 KB
testcase_24 AC 658 ms
8,344 KB
testcase_25 AC 656 ms
8,404 KB
testcase_26 AC 657 ms
8,344 KB
testcase_27 AC 656 ms
8,264 KB
testcase_28 AC 656 ms
8,352 KB
testcase_29 AC 658 ms
8,364 KB
testcase_30 AC 658 ms
8,212 KB
testcase_31 AC 659 ms
8,384 KB
testcase_32 AC 662 ms
8,356 KB
testcase_33 AC 657 ms
8,360 KB
testcase_34 AC 658 ms
8,412 KB
testcase_35 AC 659 ms
8,212 KB
testcase_36 AC 658 ms
8,236 KB
testcase_37 AC 662 ms
8,384 KB
testcase_38 AC 657 ms
8,344 KB
testcase_39 AC 659 ms
8,340 KB
testcase_40 AC 663 ms
8,228 KB
testcase_41 AC 658 ms
8,384 KB
testcase_42 AC 660 ms
8,308 KB
testcase_43 AC 666 ms
8,404 KB
testcase_44 AC 660 ms
8,440 KB
testcase_45 AC 662 ms
8,228 KB
testcase_46 AC 610 ms
8,288 KB
testcase_47 AC 128 ms
8,368 KB
testcase_48 WA -
testcase_49 AC 595 ms
8,244 KB
testcase_50 AC 656 ms
8,248 KB
testcase_51 AC 661 ms
8,444 KB
testcase_52 AC 662 ms
8,336 KB
testcase_53 AC 660 ms
8,364 KB
testcase_54 AC 662 ms
8,228 KB
testcase_55 AC 659 ms
8,260 KB
testcase_56 AC 659 ms
8,416 KB
testcase_57 AC 657 ms
8,356 KB
testcase_58 AC 658 ms
8,400 KB
testcase_59 AC 660 ms
8,356 KB
testcase_60 AC 659 ms
8,368 KB
testcase_61 AC 661 ms
8,224 KB
testcase_62 AC 657 ms
8,416 KB
testcase_63 AC 657 ms
8,256 KB
testcase_64 AC 658 ms
8,420 KB
testcase_65 AC 661 ms
8,296 KB
testcase_66 AC 658 ms
8,344 KB
testcase_67 AC 661 ms
8,352 KB
testcase_68 AC 657 ms
8,256 KB
testcase_69 AC 657 ms
8,308 KB
testcase_70 AC 660 ms
8,268 KB
testcase_71 AC 656 ms
8,392 KB
testcase_72 AC 658 ms
8,384 KB
testcase_73 AC 659 ms
8,216 KB
testcase_74 AC 660 ms
8,268 KB
testcase_75 AC 656 ms
8,284 KB
testcase_76 AC 660 ms
8,232 KB
testcase_77 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
def II(): return int(sys.stdin.readline())

def main():
    n=II()
    max_k=4471
    coin=[]
    for k in range(max_k,0,-1):
        coin+=[k*(k+1)//2]
        if coin==n:
            print(1)
            exit()
    for i in range(max_k):
        for j in range(i,max_k):
            if coin[i]+coin[j]==n:
                print(2)
                exit()
    print(3)

main()
0