QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#196216 | #6956. Many Topological Problems | yiyiyi# | WA | 49ms | 3696kb | C++14 | 671b | 2023-10-01 14:10:59 | 2023-10-01 14:11:00 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define inf 0x3f3f3f3f
#define re register
#define N 1020030
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
const int mo=1000000007;
inline int read(){
int x=0,w=0;char ch=getchar();
while (!isdigit(ch))w|=ch=='-',ch=getchar();
while (isdigit(ch))x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
return w?-x:x;
}
void solve(){
int n=read(),k=read(),ans=1;
for (int i=1;i<=k;++i)ans=ans*i%mo;
for (int i=1;i<=n;++i)ans=ans*i%mo;
for (int i=1;i<=n-k-1;++i)ans=ans*k%mo;
cout<<ans<<endl;
}
signed main(){
int T=read();
while (T--)solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 49ms
memory: 3696kb
input:
10 1 1 700503 623646 939811 584922 752155 569391 348265 116258 839298 839298 800391 216447 150847 116426 370812 168588 1000000 407619
output:
1 972550684 617838838 561525568 470024873 928010627 782371500 133886363 868118624 262962652
result:
wrong answer 6th lines differ - expected: '910196299', found: '928010627'