結果

問題 No.500 階乗電卓
ユーザー onoyik0515onoyik0515
提出日時 2017-04-18 01:46:37
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 22,912 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 02:59:33
合計ジャッジ時間 977 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |         ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(void){
	long long int N,ans=1;
	scanf("%lld",&N);

	if(N<15){
		for(;N>=1;N--){
			ans*=N;
			}
printf("%lld\n",ans);
                       } 
        else if(N<=50){
for(;N>=1;N--){
			ans*=N;
                        ans%=1000000000000;
              
			                  }
printf("%012lld\n",ans);
                       } 
        
                
         else
		{
		printf("000000000000\n");
	         }
	return 0;
}
0