結果
| 問題 |
No.500 階乗電卓
|
| コンテスト | |
| ユーザー |
onoyik0515
|
| 提出日時 | 2017-04-18 01:17:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 99 ms |
| コンパイル使用メモリ | 22,528 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 05:40:53 |
| 合計ジャッジ時間 | 725 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 12 WA * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%lld",&N);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(void){
long long int N,ans=1;
scanf("%lld",&N);
if(N<50){
for(;N>1;N--){
ans*=N;
if(ans>1000000000000)
{
ans%=1000000000000;
printf("%012lld\n",ans);
}
else{printf("%lld\n",ans);}
} }
else
{
printf("000000000000\n");
}
return 0;
}
onoyik0515