結果

問題 No.781 円周上の格子点の数え上げ
ユーザー brthyyjpbrthyyjp
提出日時 2020-08-30 10:22:02
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 674 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 154,980 KB
最終ジャッジ日時 2023-08-09 10:58:10
合計ジャッジ時間 16,097 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 642 ms
154,692 KB
testcase_01 AC 639 ms
154,952 KB
testcase_02 AC 631 ms
154,804 KB
testcase_03 AC 639 ms
154,728 KB
testcase_04 AC 639 ms
154,772 KB
testcase_05 AC 639 ms
154,764 KB
testcase_06 AC 635 ms
154,704 KB
testcase_07 AC 634 ms
154,852 KB
testcase_08 AC 629 ms
154,632 KB
testcase_09 AC 638 ms
154,884 KB
testcase_10 AC 638 ms
154,848 KB
testcase_11 AC 634 ms
154,980 KB
testcase_12 AC 644 ms
154,720 KB
testcase_13 AC 674 ms
154,824 KB
testcase_14 AC 663 ms
154,852 KB
testcase_15 AC 664 ms
154,804 KB
testcase_16 AC 656 ms
154,724 KB
testcase_17 AC 663 ms
154,820 KB
testcase_18 AC 651 ms
154,632 KB
testcase_19 AC 648 ms
154,832 KB
testcase_20 AC 647 ms
154,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():

    F = [0]*(10**7+1)
    for x in range(3200):
        for y in range(3200):
            r = x**2+y**2
            if 0 <= r <= 10**7:
                if x == 0 and y == 0:
                    F[r] += 1
                elif x == 0 or y == 0:
                    F[r] += 2
                else:
                    F[r] += 4
    x, y = map(int, input().split())
    ans = 0
    for i in range(x, y+1):
        ans = max(F[i], ans)
    print(ans)

if __name__ == '__main__':
    main()
0