結果

問題 No.1472 作為の和
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-04-09 22:06:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 571 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 75,304 KB
最終ジャッジ日時 2023-09-07 11:26:06
合計ジャッジ時間 2,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,352 KB
testcase_01 AC 80 ms
75,304 KB
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
from sys import stdin

def digsum(X):
    ret = 0
    while X:
        ret += X % 10
        X //= 10
    return ret

N = int(stdin.readline())
        
if N == 0:
    print (9,1)
elif N == 1:
    M = int(3.14159 * (10**N))

    mulmax = 0
    mulnum = 0
    for B in range(1,M+1):
        for A in range(1,B+1):
            if digsum(A*B) > mulmax:
                mulmax = digsum(A*B)
                mulnum = 1
                #print (A,B)
            elif digsum(A*B) == mulmax:
                mulnum += 1
    print (mulmax,mulnum)
else:
    print (9*N,2)
0