Task: | Nice triplets |
Sender: | HäviöLife |
Submission time: | 2016-09-06 19:28:44 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | details |
#2 | WRONG ANSWER | 0.06 s | details |
#3 | WRONG ANSWER | 0.20 s | details |
#4 | WRONG ANSWER | 0.20 s | details |
#5 | WRONG ANSWER | 0.06 s | details |
#6 | WRONG ANSWER | 0.09 s | details |
#7 | WRONG ANSWER | 0.11 s | details |
#8 | WRONG ANSWER | 0.09 s | details |
#9 | WRONG ANSWER | 0.28 s | details |
#10 | WRONG ANSWER | 0.05 s | details |
#11 | WRONG ANSWER | 0.31 s | details |
#12 | WRONG ANSWER | 0.31 s | details |
#13 | WRONG ANSWER | 0.33 s | details |
#14 | WRONG ANSWER | 0.32 s | details |
#15 | WRONG ANSWER | 0.34 s | details |
#16 | WRONG ANSWER | 0.17 s | details |
#17 | WRONG ANSWER | 0.28 s | details |
#18 | WRONG ANSWER | 0.19 s | details |
#19 | WRONG ANSWER | 0.20 s | details |
#20 | WRONG ANSWER | 0.18 s | details |
#21 | WRONG ANSWER | 0.18 s | details |
#22 | WRONG ANSWER | 0.32 s | details |
#23 | WRONG ANSWER | 0.34 s | details |
#24 | WRONG ANSWER | 0.38 s | details |
#25 | WRONG ANSWER | 0.30 s | details |
#26 | WRONG ANSWER | 0.23 s | details |
#27 | WRONG ANSWER | 0.29 s | details |
#28 | WRONG ANSWER | 0.20 s | details |
#29 | WRONG ANSWER | 0.29 s | details |
#30 | WRONG ANSWER | 0.28 s | details |
#31 | WRONG ANSWER | 0.22 s | details |
#32 | WRONG ANSWER | 0.19 s | details |
#33 | WRONG ANSWER | 0.18 s | details |
#34 | WRONG ANSWER | 0.30 s | details |
#35 | WRONG ANSWER | 0.19 s | details |
#36 | WRONG ANSWER | 0.33 s | details |
#37 | WRONG ANSWER | 0.19 s | details |
#38 | WRONG ANSWER | 0.19 s | details |
#39 | WRONG ANSWER | 0.29 s | details |
#40 | WRONG ANSWER | 0.21 s | details |
Code
#include <iostream> #include <vector> #include <stack> #include <queue> #include <algorithm> #include <cmath> #include <iomanip> #include <unordered_set> #include <stdio.h> #include <string.h> #include <unordered_map> #include <fstream> #include <set> #include <map> #define MOD 1000000007 #define ll long long #define N 20000 #define float double using namespace std; vector<int> vl[4001]; void dfs(int node, ll* maar, int* k, int dist){ k[node]=1; maar[dist]++; for(int seur:vl[node]) if(!k[seur]) dfs(seur, maar, k, dist+1); } ll vast[4000]; int main(){ int n; cin>>n; for(int i=0; i<n-1; i++){ int a,b; cin>>a>>b; vl[a].push_back(b); vl[b].push_back(a); } for(int i=1; i<=n; i++){ ll maar[4000]; int k[4000]; for(int i=0; i<4000; i++){ k[i]=0; maar[i]=0; } dfs(i, maar, k, 0); for(int e=1; e<2000; e++) if(maar[e]>=3) vast[2*e] += ((maar[e])*(maar[e]-1)*(maar[e]-2))/6; } for(int i=1; i<=n-1; i++) cout<<vast[i]<<" "; cout<<endl; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
694 141 214 214 505 141 339 339 180 ... |
correct output |
---|
0 1301 0 12977 0 76694 0 21315... |
user output |
---|
0 1301 0 33424 0 340346 0 2026... |
Test 2
Verdict: WRONG ANSWER
input |
---|
928 534 15 15 364 364 66 364 726 ... |
correct output |
---|
0 1852 0 23152 0 157299 0 4823... |
user output |
---|
0 1852 0 54233 0 659269 0 4483... |
Test 3
Verdict: WRONG ANSWER
input |
---|
2925 2093 1182 2093 2577 1182 2213 2213 1630 ... |
correct output |
---|
0 5201 0 61916 0 512021 0 2340... |
user output |
---|
0 5201 0 142033 0 1886912 0 15... |
Test 4
Verdict: WRONG ANSWER
input |
---|
3198 660 2400 660 2620 2620 3008 2400 179 ... |
correct output |
---|
0 6434 0 102245 0 1122654 0 46... |
user output |
---|
0 6434 0 216398 0 3686669 0 34... |
Test 5
Verdict: WRONG ANSWER
input |
---|
869 142 549 142 335 142 684 549 409 ... |
correct output |
---|
0 1604 0 11624 0 56768 0 17500... |
user output |
---|
0 1604 0 31885 0 270792 0 1531... |
Test 6
Verdict: WRONG ANSWER
input |
---|
1514 904 557 557 957 957 754 904 250 ... |
correct output |
---|
0 3202 0 33876 0 243297 0 9322... |
user output |
---|
0 3202 0 83328 0 995229 0 7086... |
Test 7
Verdict: WRONG ANSWER
input |
---|
2133 1166 813 1166 751 813 416 1166 1743 ... |
correct output |
---|
0 4720 0 75657 0 705952 0 2953... |
user output |
---|
0 4720 0 164596 0 2589793 0 22... |
Test 8
Verdict: WRONG ANSWER
input |
---|
1833 1368 837 837 1296 1296 481 1296 548 ... |
correct output |
---|
0 3365 0 44752 0 313240 0 1147... |
user output |
---|
0 3365 0 101698 0 1319424 0 97... |
Test 9
Verdict: WRONG ANSWER
input |
---|
3446 3060 2907 2907 1089 1089 3155 3060 444 ... |
correct output |
---|
0 7068 0 80352 0 602995 0 3052... |
user output |
---|
0 7068 0 194931 0 2434139 0 20... |
Test 10
Verdict: WRONG ANSWER
input |
---|
55 28 23 23 43 43 41 28 48 ... |
correct output |
---|
0 70 0 262 0 97 0 35 0 12 0 0 ... |
user output |
---|
0 70 0 871 0 2932 0 5461 0 600... |
Test 11
Verdict: WRONG ANSWER
input |
---|
4000 3717 1739 3717 2875 3717 598 2875 3860 ... |
correct output |
---|
0 8708 0 147350 0 1310042 0 60... |
user output |
---|
0 8698 0 313662 0 4896016 0 44... |
Test 12
Verdict: WRONG ANSWER
input |
---|
4000 2607 3595 2607 3401 3401 1971 3401 3641 ... |
correct output |
---|
0 7518 0 95122 0 775490 0 4259... |
user output |
---|
0 7518 0 216874 0 2913354 0 24... |
Test 13
Verdict: WRONG ANSWER
input |
---|
4000 337 3391 337 783 337 721 337 2376 ... |
correct output |
---|
0 7128 0 86950 0 781051 0 4647... |
user output |
---|
0 7127 0 197333 0 2810379 0 25... |
Test 14
Verdict: WRONG ANSWER
input |
---|
4000 740 1571 740 1104 1104 2145 2145 3441 ... |
correct output |
---|
0 8699 0 169586 0 2358841 0 13... |
user output |
---|
0 8689 0 345608 0 7214508 0 82... |
Test 15
Verdict: WRONG ANSWER
input |
---|
4000 878 154 878 2194 2194 2037 2194 893 ... |
correct output |
---|
0 7747 0 101093 0 954212 0 646... |
user output |
---|
0 7747 0 229661 0 3491888 0 34... |
Test 16
Verdict: WRONG ANSWER
input |
---|
4000 1739 685 1739 424 1739 743 1739 2656 ... |
correct output |
---|
0 10650673999 0 0 0 0 0 0 0 0 ... |
user output |
---|
0 10642683996 0 42528165248016... |
Test 17
Verdict: WRONG ANSWER
input |
---|
4000 2508 3693 2508 2165 2508 1689 3693 1935 ... |
correct output |
---|
0 1337338368 0 184329476 0 198... |
user output |
---|
0 1337338367 0 2675844260930 0... |
Test 18
Verdict: WRONG ANSWER
input |
---|
4000 813 3566 813 2763 813 1541 813 1762 ... |
correct output |
---|
0 426275345 0 2043667310 0 0 0... |
user output |
---|
0 425955745 0 345043927738 0 4... |
Test 19
Verdict: WRONG ANSWER
input |
---|
4000 725 282 725 365 725 3660 282 3202 ... |
correct output |
---|
0 666208836 0 972188838 0 0 0 ... |
user output |
---|
0 665727165 0 668499744321 0 5... |
Test 20
Verdict: WRONG ANSWER
input |
---|
4000 1579 3029 1579 891 3029 2534 891 257 ... |
correct output |
---|
0 1184481790 0 0 0 0 0 0 0 0 0... |
user output |
---|
0 1183583320 0 1578712810220 0... |
Test 21
Verdict: WRONG ANSWER
input |
---|
4000 1996 520 1996 1978 1996 2196 1978 2182 ... |
correct output |
---|
0 1184359951 0 2360565396 0 0 ... |
user output |
---|
0 1183485448 0 1587139251396 0... |
Test 22
Verdict: WRONG ANSWER
input |
---|
4000 1518 2792 1518 1956 1518 1572 2792 3898 ... |
correct output |
---|
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ... |
user output |
---|
0 1 0 4 0 7 0 10 0 13 0 16 0 1... |
Test 23
Verdict: WRONG ANSWER
input |
---|
4000 2266 1993 2266 2140 2266 2230 2266 866 ... |
correct output |
---|
0 4 0 4 0 4 0 4 0 4 0 4 0 4 0 ... |
user output |
---|
0 4 0 20 0 36 0 52 0 68 0 84 0... |
Test 24
Verdict: WRONG ANSWER
input |
---|
4000 3923 1832 3923 1341 3923 856 3923 1130 ... |
correct output |
---|
0 10 0 10 0 10 0 10 0 10 0 10 ... |
user output |
---|
0 10 0 60 0 110 0 160 0 210 0 ... |
Test 25
Verdict: WRONG ANSWER
input |
---|
4000 103 2255 103 24 103 2124 103 535 ... |
correct output |
---|
0 1556 0 39 0 1 0 0 0 0 0 0 0 ... |
user output |
---|
0 1556 0 25107 0 13360 0 4846 ... |
Test 26
Verdict: WRONG ANSWER
input |
---|
4000 1271 1635 1271 3388 1271 3452 1271 3371 ... |
correct output |
---|
0 2780 0 32 0 0 0 0 0 0 0 0 0 ... |
user output |
---|
0 2780 0 60815 0 15635 0 5712 ... |
Test 27
Verdict: WRONG ANSWER
input |
---|
4000 257 1671 257 2439 257 756 257 1393 ... |
correct output |
---|
0 1406 0 56 0 4 0 0 0 0 0 0 0 ... |
user output |
---|
0 1406 0 21145 0 14871 0 7099 ... |
Test 28
Verdict: WRONG ANSWER
input |
---|
4000 3694 1140 3694 1224 3694 1601 3694 3050 ... |
correct output |
---|
0 1570 0 83 0 15 0 2 0 0 0 0 0... |
user output |
---|
0 1570 0 24971 0 13455 0 4175 ... |
Test 29
Verdict: WRONG ANSWER
input |
---|
4000 1449 2360 1449 611 1449 2332 1449 830 ... |
correct output |
---|
0 2504 0 43 0 1 0 0 0 0 0 0 0 ... |
user output |
---|
0 2503 0 51916 0 16023 0 7024 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
4000 2519 595 2519 1119 2519 500 2519 2127 ... |
correct output |
---|
0 2250 0 54 0 0 0 0 0 0 0 0 0 ... |
user output |
---|
0 2250 0 43551 0 16711 0 4592 ... |
Test 31
Verdict: WRONG ANSWER
input |
---|
4000 2787 2780 2787 3471 2787 206 2787 2050 ... |
correct output |
---|
0 1565 0 90 0 1 0 0 0 0 0 0 0 ... |
user output |
---|
0 1565 0 24955 0 14981 0 3592 ... |
Test 32
Verdict: WRONG ANSWER
input |
---|
4000 1977 2196 1977 1810 1977 128 1977 436 ... |
correct output |
---|
0 1536 0 67 0 6 0 0 0 0 0 0 0 ... |
user output |
---|
0 1536 0 25113 0 15494 0 4927 ... |
Test 33
Verdict: WRONG ANSWER
input |
---|
4000 3377 1793 3377 2977 3377 711 3377 2184 ... |
correct output |
---|
0 2524 0 36 0 3 0 0 0 0 0 0 0 ... |
user output |
---|
0 2524 0 51943 0 13713 0 6988 ... |
Test 34
Verdict: WRONG ANSWER
input |
---|
4000 3617 2852 3617 3552 3617 2064 3617 88 ... |
correct output |
---|
0 2492 0 37 0 0 0 0 0 0 0 0 0 ... |
user output |
---|
0 2491 0 51600 0 16545 0 5191 ... |
Test 35
Verdict: WRONG ANSWER
input |
---|
4000 2713 1183 2713 565 2713 1432 2713 2859 ... |
correct output |
---|
0 1370 0 99 0 4 0 38 0 0 0 0 0... |
user output |
---|
0 1369 0 20184 0 13282 0 2844 ... |
Test 36
Verdict: WRONG ANSWER
input |
---|
4000 3350 3568 3350 968 3350 3110 3350 149 ... |
correct output |
---|
0 2026 0 49 0 45 0 12 0 0 0 0 ... |
user output |
---|
0 1795 0 32103 0 11481 0 6893 ... |
Test 37
Verdict: WRONG ANSWER
input |
---|
4000 1794 1797 1794 355 1794 728 1794 2107 ... |
correct output |
---|
0 2240 0 53 0 1 0 0 0 0 0 0 0 ... |
user output |
---|
0 2240 0 43822 0 16150 0 6876 ... |
Test 38
Verdict: WRONG ANSWER
input |
---|
4000 1571 2107 1571 1258 1571 1808 1571 1754 ... |
correct output |
---|
0 1765 0 51 0 4 0 0 0 0 0 0 0 ... |
user output |
---|
0 1765 0 30647 0 13363 0 6876 ... |
Test 39
Verdict: WRONG ANSWER
input |
---|
4000 2132 1514 2132 3357 2132 355 2132 3958 ... |
correct output |
---|
0 1991 0 34 0 12 0 0 0 0 0 0 0... |
user output |
---|
0 1991 0 37119 0 13519 0 9569 ... |
Test 40
Verdict: WRONG ANSWER
input |
---|
4000 1621 743 1621 1182 1621 1598 1621 2693 ... |
correct output |
---|
0 2500 0 22 0 2 0 0 0 0 0 0 0 ... |
user output |
---|
0 2499 0 51615 0 11114 0 5158 ... |