結果
問題 | No.500 階乗電卓 |
ユーザー | tatuyan_edson |
提出日時 | 2017-03-22 10:45:17 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 792 ms |
コンパイル使用メモリ | 20,224 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 02:46:37 |
合計ジャッジ時間 | 1,460 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%llu",&input); | ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ unsigned long long num=1,input,i; int flg=0; scanf("%llu",&input); for(i=2;i<=input;i++){ num*=i; if(num>1000000000000) flg=1; num%=1000000000000; if(num==0) break; } printf(flg==1?"%012llu\n":"%llu\n",num); return 0; }