結果
| 問題 | No.391 CODING WAR |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-07-17 18:18:25 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 234 ms / 2,000 ms |
| コード長 | 292 bytes |
| 記録 | |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 30,536 KB |
| 最終ジャッジ日時 | 2026-02-23 21:54:09 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
コンパイルメッセージ
main.c:3:10: warning: data definition has no type or storage class
3 | ll n,s,t;m,i;
| ^
main.c: In function ‘main’:
main.c:6:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
6 | scanf("%lld%d",&n,&m);
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | #define ll long long
main.c:10:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
10 | s=!printf("%d",s%P);
| ^~~~~~
main.c:10:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:10:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
10 | s=!printf("%d",s%P);
| ~^
| |
| int
| %lld
ソースコード
#define ll long long
#define P 1000000007
ll n,s,t;m,i;
ll pom(ll a,ll i,ll m){return i?i%2?pom(a*a%m,i/2,m)*a%m:pom(a*a%m,i/2,m)%m:1;}
main(){
scanf("%lld%d",&n,&m);
s=pom(m,n,P);
t=1;
for(i=1;i<m;i++)s+=(i%2?-1:1)*(t=t*(m-i+1)%P*pom(i,P-2,P)%P)*pom(m-i,n,P)%P+P;
s=!printf("%d",s%P);
}
testestest