結果
問題 | No.500 階乗電卓 |
ユーザー |
|
提出日時 | 2017-04-07 22:42:56 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 267 bytes |
コンパイル時間 | 334 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 02:50:27 |
合計ジャッジ時間 | 1,129 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%lld",&n); | ^~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>int main(int argc, char const *argv[]){long long n,ans=1,i;scanf("%lld",&n);if(n<60){for(i=n;i>1;i--){ans*=i;ans%=1000000000000;}if(n<15){printf("%lld\n",ans);return 0;}}else ans=0;printf("%012lld\n",ans);return 0;}