結果

問題 No.1472 作為の和
ユーザー titiatitia
提出日時 2021-04-10 00:55:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,140 KB
最終ジャッジ日時 2023-09-07 19:51:11
合計ジャッジ時間 1,167 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,916 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import pi

N=int(input())

if N<=2:
    MAX=int(pi*(10**N))
    SS=-1
    ind=1

    for i in range(MAX+1):
        for j in range(MAX+1):
            S1=0
            for s in str(i):
                S1+=int(s)
            S2=0
            for s in str(j):
                S2+=int(s)

            if SS==S1*S2:
                ind+=1
            elif SS<S1*S2:
                SS=S1*S2
                ind=1
    print(SS,ind)

else:
    print((2+9*N)**2,1)
            
0