QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#251621 | #5164. 建造军营 | IANYEYZ | 10 | 330ms | 38208kb | C++14 | 619b | 2023-11-14 21:57:20 | 2023-11-14 21:57:21 |
Judging History
answer
#include<iostream>
#include<vector>
#define int long long
using namespace std;
int pow2[500010],n,m,u,v,ans;
vector<int> E[500010];
/* utility */
/* checker */
/* Solution */
signed main()
{
cin >> n >> m;
for(int i = 1;i <= m;i++) {
cin >> u >> v;
E[u].push_back(v);
E[v].push_back(u);
}
if(m == n - 1) {
pow2[0] = 1;
for(int i = 1;i <= n + 1;i++) {
pow2[i] = (pow2[i - 1] * 2) % (int)(1e9 + 7);
}
for(int i = 1;i <= n;i++) {
ans += pow2[n - 2] * (n - i) % (int)(1e9 + 7);
ans += pow2[n - 1];
ans %= (int)(1e9 + 7);
}
cout << ans << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 16732kb
input:
8 8 1 5 5 4 4 1 7 8 3 7 6 3 1 3 2 3
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #2:
score: 0
Wrong Answer
time: 2ms
memory: 16280kb
input:
8 8 6 8 8 4 4 6 7 2 1 7 3 1 4 7 5 8
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 16144kb
input:
8 9 5 6 6 4 4 5 5 3 3 2 2 5 8 1 7 8 4 7
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 17056kb
input:
16 20 2 12 12 14 14 2 2 7 7 11 11 2 15 1 1 4 4 15 15 9 9 16 16 15 15 10 10 3 3 15 13 6 8 13 11 8 9 2 5 1
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 16112kb
input:
16 19 9 4 4 7 7 9 9 8 8 13 13 9 9 5 5 16 16 9 9 11 11 14 14 9 15 6 2 15 8 2 10 16 1 10 12 1 3 12
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #6:
score: 0
Wrong Answer
time: 3ms
memory: 17096kb
input:
16 18 6 7 7 3 3 6 1 15 15 4 4 1 1 13 13 16 16 1 12 11 5 12 2 5 8 2 14 8 10 14 7 10 16 14 9 7
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #7:
score: 0
Wrong Answer
time: 3ms
memory: 16148kb
input:
16 19 11 10 10 16 16 11 11 2 2 3 3 11 12 14 14 15 15 12 7 5 5 8 8 7 6 13 9 6 3 9 4 3 1 4 12 1 8 14
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #8:
score: 0
Wrong Answer
time: 5ms
memory: 16380kb
input:
2955 4192 216 639 639 1387 1387 216 216 2383 2383 2654 2654 216 216 2210 2210 2605 2605 216 216 2742 2742 2655 2655 2940 2940 593 593 552 552 510 510 1057 1057 965 965 1780 1780 837 837 2254 2254 1892 1892 2545 2545 2401 2401 1750 1750 321 321 2050 2050 1086 1086 528 528 1701 1701 538 538 2704 2704 ...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #9:
score: 0
Wrong Answer
time: 2ms
memory: 15684kb
input:
2945 4099 1849 1337 1337 169 169 1849 1849 1074 1074 736 736 1849 1849 812 812 1854 1854 1849 1849 1659 1659 1799 1799 1271 1271 351 351 265 265 2619 2619 1021 1021 862 862 1317 1317 1951 1951 1816 1816 1353 1353 706 706 2486 2486 1776 1776 2693 2693 258 258 252 252 2030 2030 1524 1524 490 490 2372 ...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #10:
score: 5
Accepted
time: 167ms
memory: 34736kb
input:
499759 499758 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
454043638
result:
ok 1 number(s): "454043638"
Test #11:
score: 5
Accepted
time: 187ms
memory: 34620kb
input:
499934 499933 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
363824240
result:
ok 1 number(s): "363824240"
Test #12:
score: 0
Wrong Answer
time: 250ms
memory: 37152kb
input:
499910 499909 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
913048743
result:
wrong answer 1st numbers differ - expected: '595142370', found: '913048743'
Test #13:
score: 0
Wrong Answer
time: 234ms
memory: 36892kb
input:
497434 497433 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
416698161
result:
wrong answer 1st numbers differ - expected: '672159037', found: '416698161'
Test #14:
score: 0
Wrong Answer
time: 227ms
memory: 36896kb
input:
498594 498593 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
125394731
result:
wrong answer 1st numbers differ - expected: '730193382', found: '125394731'
Test #15:
score: 0
Wrong Answer
time: 232ms
memory: 33144kb
input:
491691 491691 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #16:
score: 0
Wrong Answer
time: 217ms
memory: 34524kb
input:
494909 494909 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 ...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #17:
score: 0
Wrong Answer
time: 312ms
memory: 37660kb
input:
496680 669728 278429 179810 179810 78114 78114 278429 278429 263631 263631 473590 473590 278429 278429 400998 400998 478024 478024 278429 278429 411923 411923 316261 316261 361842 361842 131858 131858 62950 62950 374524 374524 354457 354457 159387 159387 84068 84068 468583 468583 281544 281544 21024...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #18:
score: 0
Wrong Answer
time: 304ms
memory: 37972kb
input:
492468 674661 172895 370268 370268 72327 72327 172895 172895 83421 83421 56710 56710 172895 172895 91556 91556 487022 487022 172895 172895 301253 301253 471820 471820 186463 186463 219659 219659 222758 222758 475707 475707 198110 198110 112885 112885 87509 87509 417623 417623 183964 183964 179360 17...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #19:
score: 0
Wrong Answer
time: 314ms
memory: 38208kb
input:
495531 685632 363871 199154 199154 290146 290146 363871 363871 285706 285706 181450 181450 363871 363871 57397 57397 246929 246929 363871 363871 100675 100675 161126 161126 348991 348991 51059 51059 187343 187343 178826 178826 214135 214135 77835 77835 49971 49971 313842 313842 378994 378994 324892 ...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements
Test #20:
score: 0
Wrong Answer
time: 330ms
memory: 38184kb
input:
492842 688856 407751 199116 199116 305848 305848 407751 407751 237041 237041 241971 241971 407751 407751 122561 122561 220589 220589 407751 407751 187952 187952 16432 16432 215452 215452 411729 411729 406334 406334 338946 338946 113993 113993 211645 211645 80319 80319 159214 159214 335495 335495 231...
output:
result:
wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements