結果
| 問題 | No.502 階乗を計算するだけ |
| コンテスト | |
| ユーザー |
%20
|
| 提出日時 | 2017-04-08 05:17:34 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 170 bytes |
| 記録 | |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 26,292 KB |
| 最終ジャッジ日時 | 2026-02-21 23:39:35 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:1:7: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
1 | const m=1e9+7,s=2e8+2,a[]={1,616021053,196358370,665615525,720451408};
| ^
main.c:1:15: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | const m=1e9+7,s=2e8+2,a[]={1,616021053,196358370,665615525,720451408};
| ^
main.c:1:23: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
1 | const m=1e9+7,s=2e8+2,a[]={1,616021053,196358370,665615525,720451408};
| ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(i){
| ^~~~
main.c: In function 'main':
main.c:3:1: warning: old-style function definition [-Wold-style-definition]
main.c:3:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | scanf("%ld",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | const m=1e9+7,s=2e8+2,a[]={1,616021053,196358370,665615525,720451408};
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | scanf("%ld",&n);
| ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
6 | printf("%d",x);
| ^~~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
const m=1e9+7,s=2e8+2,a[]={1,616021053,196358370,665615525,720451408};
long n,x;
main(i){
scanf("%ld",&n);
if(n<m)for(x=a[n/s],i=n%s;i--;)x=x*n--%m;
printf("%d",x);
}
%20