結果

問題 No.500 階乗電卓
コンテスト
ユーザー cologne
提出日時 2025-11-18 15:04:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,800 KB
実行使用メモリ 53,932 KB
最終ジャッジ日時 2025-11-18 15:05:00
合計ジャッジ時間 2,509 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys


def input(): return sys.stdin.readline().rstrip('\n')


def main():
    a = 1
    n = int(input())
    for i in range(1, n+1):
        a = (a*i) % (10**12)
        if a == 0:
            break

    if a == 0:
        print('0'*12)
    else:
        print(a)


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