ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#200631 | #3473. 欧拉回路 | ptezczh | 100 | 514ms | 1908kb | C++ | 525b | 2024-01-07 11:57:14 | 2024-01-07 12:05:56 |
answer
#include<bits/stdc++.h>
using namespace std;
unsigned long long n,m,a[200000],z;
unsigned long long p=1,mod=1000000007;
int main()
{
cin>>n>>m;
int u,v;
for(int i=1;i<=m;i++)
{
cin>>u>>v;
a[u]++;
a[v]++;
}
for(int i=1;i<=n;i++)
{
if(a[i]%2!=0)
z++;
}
if(z%2==0)
{
cout<<z/2<<" ";
for(int i=1;i<=z;i+=2)
{
p*=i;
p%=mod;
}
cout<<p;
}else
{
cout<<z/2+1;
for(int i=1;i<=z-1;i+=2)
{
p*=i;
p%=mod;
}
p*=z;
p%=mod;
cout<<p;
}
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1204kb
input:
5 16 2 3 4 2 5 2 1 5 3 5 3 3 2 1 3 3 2 3 3 3 3 2 4 2 5 1 2 4 4 5 1 4
output:
1 1
result:
ok single line: '1 1'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1204kb
input:
5 11 2 4 5 2 1 5 3 5 5 5 5 2 5 2 2 5 4 4 1 1 2 2
output:
2 3
result:
ok single line: '2 3'
Test #3:
score: 10
Accepted
time: 1ms
memory: 1208kb
input:
5 20 4 1 3 4 5 4 2 3 4 5 1 2 3 1 4 4 1 3 1 3 2 5 3 5 2 4 4 1 3 2 2 3 5 5 5 5 4 4 2 4
output:
1 1
result:
ok single line: '1 1'
Test #4:
score: 10
Accepted
time: 0ms
memory: 1208kb
input:
5 11 3 2 5 2 4 2 1 3 2 4 5 5 1 2 3 4 4 1 4 1 1 3
output:
2 3
result:
ok single line: '2 3'
Test #5:
score: 10
Accepted
time: 0ms
memory: 1208kb
input:
5 20 5 3 2 3 1 3 4 3 5 5 2 5 1 3 4 2 1 5 4 2 5 1 3 3 2 5 2 4 4 1 2 2 5 3 4 2 3 4 3 4
output:
1 1
result:
ok single line: '1 1'
Test #6:
score: 10
Accepted
time: 106ms
memory: 1908kb
input:
90000 100000 86148 7841 35458 7841 22053 7841 72597 7841 46234 86148 66349 86148 84430 66349 13043 8...
output:
27374 895119460
result:
ok single line: '27374 895119460'
Test #7:
score: 10
Accepted
time: 103ms
memory: 1904kb
input:
90000 100000 31836 79514 63300 31836 66865 31836 32530 66865 11319 66865 83663 32530 44332 83663 278...
output:
27295 247300879
result:
ok single line: '27295 247300879'
Test #8:
score: 10
Accepted
time: 103ms
memory: 1904kb
input:
90000 100000 4273 50379 79924 50379 69076 4273 22163 79924 18129 50379 4652 18129 41333 22163 34378 ...
output:
27344 855444931
result:
ok single line: '27344 855444931'
Test #9:
score: 10
Accepted
time: 103ms
memory: 1904kb
input:
90000 100000 36888 28219 7060 36888 88192 28219 67345 88192 8034 7060 80465 8034 69104 28219 69828 7...
output:
27275 839765813
result:
ok single line: '27275 839765813'
Test #10:
score: 10
Accepted
time: 98ms
memory: 1592kb
input:
50000 100000 14562 47661 779 47661 31060 47661 37672 47661 3390 37672 1402 37672 12245 14562 27426 7...
output:
0 1
result:
ok single line: '0 1'
Extra Test:
score: 0
Extra Test Passed