QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#877999 | #9911. 路南柯 | Chenly | 0 | 24ms | 25472kb | C++20 | 1.1kb | 2025-02-01 12:57:46 | 2025-02-01 12:57:48 |
Judging History
answer
// #define NDEBUG
#include<bits/stdc++.h>
#define For(i,j,k) for(int i=(j);i<=(k);i++)
#define ForD(i,j,k) for(int i=(j);i>=(k);i--)
#define int long long
#define endl '\n'
using namespace std;
bool Mbe;
const int N=5e3+5,K=1e3+5,mod=998244353;
int qpow(int a,int b){
int ans=1;
while(b){
if(b&1) ans=ans*a%mod;
a=a*a%mod; b>>=1;
}
return ans;
}
int p,k,n;
#define pb push_back
struct Tree{
vector<int> E[N];
void in(){
For(i,1,n-1){
int u,v; cin>>u>>v;
E[u].pb(v),E[v].pb(u);
}
}
}Tr[K];
void solve(){
cin>>p>>k>>n;
For(i,1,k) Tr[i].in();
if(p==1){
cout<<qpow(n,n-2)<<endl;
}else{
cout<<0<<endl;
}
}
bool Med;
signed main(){
fprintf(stderr,"%.3lf MB\n",(&Mbe-&Med)/1048576.0);
// freopen("1.in","r",stdin), freopen("1.out","w",stdout);
ios::sync_with_stdio(false); cin.tie(0),cout.tie(0);
int _=1;
cin>>_;
while(_--) solve();
cerr<<1e3*clock()/CLOCKS_PER_SEC<<" ms\n";
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 3968kb
input:
10 10 4 2 5 1 8 6 1 9 3 7 1 8 10 2 6 4 3 4 10 4 3 3 1 5 3 6 3 2 3 8 7 8 2 7 10 8 9 10 5 4 10 8 10 3 6 3 9 8 1 10 4 2 2 7 8 4 10 10 6 6 8 1 7 2 6 3 5 3 9 4 2 6 9 3 1 10 2 8 10 4 9 1 9 3 5 7 6 3 1 8 8 7 4 2 10 9 2 9 1 7 1 5 6 8 2 3 9 5 10 5 4 1 10 10 2 9 8 1 8 5 6 3 7 1 6 2 9 8 2 10 4 2 10 5 7 6 2 8 7...
output:
0 100000000 0 0 0 0 0 0 0 0
result:
wrong answer Integer parameter [name=k] equals to 0, violates the range [1, 10]
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 24ms
memory: 25472kb
input:
100 100 90 19 79 98 23 34 50 41 31 52 61 19 50 30 49 5 95 65 22 44 72 89 49 77 27 7 48 2 28 25 56 12 97 63 98 43 10 4 50 33 12 13 54 16 100 43 23 69 53 5 56 85 39 6 64 92 100 59 2 71 44 29 59 97 64 39 75 53 59 89 16 35 67 16 6 43 38 51 36 22 58 70 3 29 9 61 99 11 49 95 27 72 73 89 23 3 14 3 61 57 26...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
wrong answer Integer parameter [name=k] equals to 0, violates the range [1, 100]