QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#747235 | #7755. Game on a Forest | 1926406757 | WA | 1ms | 4428kb | C++20 | 522b | 2024-11-14 16:39:20 | 2024-11-14 16:39:21 |
Judging History
answer
#include<iostream>
#define int long long
using namespace std;
const int N=1e5+10;
int st[N];
signed main()
{
cin.tie(0),cout.tie(0),ios::sync_with_stdio(false);
int n,m;
cin>>n>>m;
for(int i=1;i<=m;i++)
{
int x,y;
cin>>x>>y;
st[x]++,st[y]++;
}
int res=0;
if(n%2==0&&m%2==0)
{
res=0;
}
else if(n%2==0)
{
res=m;
}
else if(m%2==0)
{
for(int i=1;i<=n;i++) if(st[i]%2==0) res++;
}
else
for(int i=1;i<=n;i++) if(st[i]==1) res++;
cout<<res<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
3 1 1 2
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
4 3 1 2 2 3 3 4
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
100000 1 4647 17816
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
100000 2 64075 72287 63658 66936
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
100000 3 59930 72281 31689 59132 20469 33165
output:
3
result:
ok 1 number(s): "3"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
100000 10 20391 78923 27822 80617 21749 25732 12929 79693 42889 52515 59064 99869 29031 41875 4463 17813 13407 42498 19120 20957
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 1ms
memory: 4028kb
input:
99999 101 34378 94161 67696 83255 24557 25591 11476 58475 5684 38157 33843 35321 9046 24028 14293 77681 587 42098 9402 27228 6999 13980 27118 84005 3622 8353 13545 51621 16998 63647 32912 53178 15206 15815 56517 86335 5563 93770 153 278 11242 41753 75098 76792 1695 22836 25936 33352 2765 6778 19597 ...
output:
200
result:
ok 1 number(s): "200"
Test #8:
score: 0
Accepted
time: 1ms
memory: 4392kb
input:
100000 1001 298 77037 4590 12413 23983 44856 15445 16769 81205 99801 62678 90775 7513 11129 27455 63264 39986 44211 61692 72309 60465 67632 66675 72861 4281 28582 26376 65551 9751 60666 4388 47945 1077 1132 53716 62874 39894 55139 28957 63412 41201 89573 6166 10477 2322 23039 24579 87570 16337 90895...
output:
1001
result:
ok 1 number(s): "1001"
Test #9:
score: 0
Accepted
time: 1ms
memory: 4408kb
input:
100000 2000 15502 16605 10164 34454 48764 97837 3462 26651 32457 52288 2871 13083 9012 55876 45290 81448 2879 15152 5347 6203 14519 50871 4513 19513 15241 25215 18759 76715 53123 97123 10178 25478 1955 4281 2346 30453 1770 53064 38900 57761 51275 65969 4801 21613 655 1131 15956 52140 39128 47232 416...
output:
0
result:
ok 1 number(s): "0"
Test #10:
score: 0
Accepted
time: 1ms
memory: 4424kb
input:
99999 3000 27340 79581 55921 68664 459 1145 55880 59400 25884 34981 27695 55440 15559 31392 16400 51581 7299 22688 24107 72852 16642 62108 5610 36856 19456 38723 50096 89933 44262 85879 25331 25638 38103 72312 58090 61238 10581 65561 4612 6491 11386 21234 29353 90524 8877 67738 48566 69766 26900 320...
output:
94369
result:
ok 1 number(s): "94369"
Test #11:
score: -100
Wrong Answer
time: 1ms
memory: 4428kb
input:
99999 5001 19 10279 7996 89627 180 1602 29518 35569 60273 86569 11609 16548 32072 50554 59970 95300 27355 42751 29889 66830 14756 14827 27129 28784 16912 94660 54294 61296 34871 47816 8523 17150 46256 82814 32476 48290 13973 34558 168 283 6709 63673 49056 50996 10834 31268 42191 62180 18544 55231 70...
output:
9059
result:
wrong answer 1st numbers differ - expected: '9074', found: '9059'