結果

問題 No.500 階乗電卓
ユーザー startcpp
提出日時 2017-04-07 22:42:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 53,364 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-16 02:38:42
合計ジャッジ時間 1,051 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

long long n;

int main() {
	cin >> n;
	
	long long ans = 1;
	for (int i = 1; i <= n; i++) {
		ans *= i;
		ans %= 1000000000000;
		if (ans == 0) { break; }
	}
	cout << ans << endl;
	
	return 0;
}
0