QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#464516 | #5029. 在路上 | stupid | 2 | 201ms | 19744kb | C++14 | 1004b | 2024-07-06 11:04:50 | 2024-07-06 11:04:50 |
Judging History
answer
#include "path.h"
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int INF=1e9+7;
int N,a[1010][1010],dep[1010],siz[1010],MIN,ans;
vector <int> t[1010],v[1010];
void dfs(int x)
{
siz[x]=1;int MAX=0;
for(int y:v[x])
dfs(y),siz[x]+=siz[y],MAX=max(MAX,siz[y]);
MAX=max(MAX,N-siz[x]);
if(MAX<=N/2) MIN=MAX,ans=x;
}
int centroid(int id,int n,int m)
{
N=n;if(id==1) return ask(1,2,3);
for(int j=2;j<=n;++j) for(int k=j+1;k<=n;++k)
a[j][k]=a[k][j]=ask(1,j,k);
for(int j=2;j<=n;++j)
{
for(int k=2;k<=n;++k)
if(a[j][k]&&a[j][k]!=1&&a[j][k]!=j) ++dep[j];
t[dep[j]].push_back(j);
}
for(int x:t[0]) v[1].push_back(x);
for(int i=1;i<=n;++i)
{
for(int j:t[i]) for(int k:t[i-1])
if(a[j][k]==k) v[k].push_back(j);
}
MIN=INF,dfs(1);
for(int i=0;i<=n;++i) t[i].clear(),v[i].clear(),dep[i]=0;
return ans;
}
詳細信息
Subtask #1:
score: 2
Accepted
Test #1:
score: 2
Accepted
time: 0ms
memory: 14032kb
input:
1 100 100 3 1 2 3 1 2 3 3 1 3 1 2 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 3 1 3 3 1 3 3 1 3 3 1 3 3 1 3 3 1 3 3 1 3 1 2 3 1 2 3 3 1 3 3 1 3 1 2 3 3 1 3 3 1 3 1 2 3 3 1 3 3 1 3 1 2 3 3 1 3 3 1 3 3 1 3 1 2 3 1 2 3 3 1 3 3 1 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 3 3 1 3 3 1 3 1 2 3 1 2 3 1 2 3 3 1 3 3 1 3 3 1 3 ...
result:
ok correct
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 8
Accepted
time: 98ms
memory: 19744kb
input:
2 10 10000000 999 60 112 98 509 586 175 588 875 861 516 920 370 781 249 999 649 292 308 934 949 437 92 506 752 547 866 869 510 984 228 104 612 202 630 360 809 56 107 566 448 940 726 146 299 941 50 319 794 670 603 365 492 728 872 829 942 451 632 373 106 909 25 306 995 735 99 568 673 75 573 383 407 56...
result:
ok correct
Test #3:
score: 0
Accepted
time: 95ms
memory: 17028kb
input:
2 10 10000000 999 60 112 98 509 586 175 588 875 861 516 920 370 781 249 999 649 292 308 934 949 437 92 506 752 547 866 869 510 984 228 104 612 202 630 360 809 56 107 566 448 940 726 146 299 941 50 319 794 670 603 365 492 728 872 829 942 451 632 373 106 909 25 306 995 735 99 568 673 75 573 383 407 56...
result:
ok correct
Test #4:
score: 0
Accepted
time: 92ms
memory: 19012kb
input:
2 10 10000000 999 60 112 959 68 586 835 91 836 634 516 272 912 781 249 655 11 466 103 934 816 904 92 576 83 687 435 871 510 758 519 842 882 339 221 2 917 5 605 477 448 323 723 744 494 941 50 668 751 670 336 365 95 877 159 829 957 451 632 591 616 909 83 452 607 735 99 22 570 755 354 172 711 742 870 3...
result:
ok correct
Test #5:
score: 0
Accepted
time: 88ms
memory: 19584kb
input:
2 10 10000000 999 373 769 355 568 586 175 588 836 203 901 272 948 781 80 655 11 292 103 934 595 904 188 865 989 698 493 871 510 893 228 842 882 339 630 2 550 829 107 477 636 385 726 146 299 764 670 668 381 631 336 365 95 974 872 829 733 678 669 373 571 183 752 452 607 735 179 22 673 755 354 383 711 ...
result:
ok correct
Test #6:
score: 0
Accepted
time: 63ms
memory: 19460kb
input:
2 10 10000000 999 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 68...
result:
ok correct
Test #7:
score: 0
Accepted
time: 62ms
memory: 19660kb
input:
2 10 10000000 999 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 688 68...
result:
ok correct
Test #8:
score: 0
Accepted
time: 98ms
memory: 16128kb
input:
2 10 10000000 999 158 826 595 867 47 385 664 154 455 857 622 561 166 780 801 763 33 310 605 36 199 718 762 911 419 109 947 369 861 841 902 657 172 175 461 814 473 43 90 875 62 238 669 791 68 435 405 663 756 255 628 798 745 878 257 773 652 662 832 735 75 363 129 359 230 351 667 873 602 783 988 253 58...
result:
ok correct
Test #9:
score: 0
Accepted
time: 99ms
memory: 16196kb
input:
2 10 10000000 999 279 772 39 665 622 173 514 309 407 623 288 342 100 529 202 417 132 611 186 430 634 796 454 842 92 53 977 712 975 158 654 66 822 452 6 333 596 593 91 119 242 503 190 82 97 575 663 574 75 598 299 334 31 147 382 988 702 11 801 338 164 696 573 182 899 948 507 168 331 939 442 137 581 52...
result:
ok correct
Test #10:
score: 0
Accepted
time: 79ms
memory: 17800kb
input:
2 10 10000000 999 60 208 208 208 208 175 208 875 861 208 208 370 208 208 208 208 292 208 208 949 208 208 208 752 547 208 869 510 208 208 208 612 208 208 360 809 208 107 208 448 208 208 208 208 941 208 319 794 208 603 208 208 208 208 208 208 451 208 373 106 208 25 306 208 735 99 208 673 208 573 383 2...
result:
ok correct
Test #11:
score: 0
Accepted
time: 77ms
memory: 17852kb
input:
2 10 10000000 999 60 208 208 208 208 175 208 875 861 208 208 370 208 208 208 208 292 208 208 949 208 208 208 752 547 208 869 510 208 208 208 612 208 208 360 809 208 107 208 448 208 208 208 208 941 208 319 794 208 603 208 208 208 208 208 208 451 208 373 106 208 25 306 208 735 99 208 673 208 573 383 2...
result:
ok correct
Test #12:
score: 0
Accepted
time: 82ms
memory: 16752kb
input:
2 10 10000000 999 198 236 761 86 644 189 7 741 274 656 547 36 825 827 740 333 896 832 575 37 359 456 833 590 427 837 100 60 424 237 208 742 266 543 941 906 422 423 953 787 397 337 215 469 979 51 404 546 603 168 849 472 737 135 500 701 608 696 764 695 64 590 851 194 89 278 864 314 529 165 448 414 471...
result:
ok correct
Test #13:
score: 0
Accepted
time: 91ms
memory: 17956kb
input:
2 10 10000000 999 198 236 761 86 644 189 7 741 274 656 547 36 825 827 740 333 896 832 575 37 359 456 833 590 427 837 100 60 424 237 208 742 266 543 941 906 422 423 953 787 397 337 215 469 979 51 404 546 603 168 849 472 737 135 500 701 608 696 764 695 64 590 851 194 89 278 864 314 529 165 448 414 471...
result:
ok correct
Test #14:
score: 0
Accepted
time: 112ms
memory: 16296kb
input:
2 10 10000000 999 60 112 98 509 586 175 588 875 861 516 920 370 781 249 999 649 292 308 934 949 437 92 506 752 547 866 869 510 984 228 338 612 202 630 360 809 56 107 566 448 940 726 146 299 941 50 319 794 670 603 365 492 728 872 829 942 451 632 373 106 909 25 306 995 735 99 568 673 75 573 383 407 56...
result:
ok correct
Test #15:
score: 0
Accepted
time: 121ms
memory: 16784kb
input:
2 10 10000000 999 60 112 98 509 586 175 588 875 861 516 920 370 781 249 999 649 292 308 934 949 437 92 506 752 547 866 869 510 984 228 991 612 202 630 360 809 56 107 566 448 940 726 146 299 941 50 319 794 670 603 365 492 728 872 829 942 451 632 373 106 909 25 306 995 735 99 568 673 75 573 383 407 56...
result:
ok correct
Test #16:
score: 0
Accepted
time: 95ms
memory: 18336kb
input:
2 10 10000000 999 60 112 125 509 291 175 588 875 861 516 920 370 781 618 999 649 292 45 934 949 437 92 506 752 547 866 869 510 208 991 338 612 208 630 360 809 56 107 737 448 940 726 208 291 941 50 319 794 670 603 365 618 291 159 829 942 451 632 373 106 847 25 306 125 735 99 568 673 642 573 383 338 5...
result:
ok correct
Test #17:
score: 0
Accepted
time: 87ms
memory: 19304kb
input:
2 10 10000000 999 60 112 338 509 847 175 588 875 861 516 920 370 781 249 999 649 292 618 934 949 437 92 506 752 547 866 869 510 125 291 515 612 737 630 360 809 56 107 208 448 940 726 515 338 941 50 319 794 670 603 365 125 125 515 829 942 451 632 373 106 902 25 306 515 735 99 568 673 907 573 383 291 ...
result:
ok correct
Test #18:
score: 0
Accepted
time: 76ms
memory: 19724kb
input:
2 10 10000000 999 60 736 736 736 736 175 736 875 861 736 736 370 736 736 736 736 292 736 736 949 736 736 736 752 547 736 869 510 736 736 736 612 736 736 360 809 736 107 736 448 736 736 736 736 941 736 319 794 736 603 736 736 736 736 736 736 451 736 373 106 736 25 306 736 735 99 736 673 736 573 383 7...
result:
ok correct
Test #19:
score: 0
Accepted
time: 77ms
memory: 19320kb
input:
2 10 10000000 999 60 736 736 736 736 175 736 875 861 736 736 370 736 736 736 736 292 736 736 949 736 736 736 752 547 736 869 510 736 736 736 612 736 736 360 809 736 107 736 448 736 736 736 736 941 736 319 794 736 603 736 736 736 736 736 736 451 736 373 106 736 25 306 736 735 99 736 673 736 573 383 7...
result:
ok correct
Test #20:
score: -8
Wrong Answer
time: 93ms
memory: 18072kb
input:
2 10 10000000 999 60 825 542 207 182 175 71 875 861 275 642 370 725 600 184 242 292 978 56 949 189 839 896 752 547 479 869 510 328 592 288 612 373 975 360 809 317 107 642 448 822 742 200 947 941 614 319 794 580 603 473 760 89 872 342 160 451 326 373 106 488 25 306 39 735 99 533 673 94 573 383 473 56...
result:
wrong answer
Subtask #3:
score: 0
Wrong Answer
Test #22:
score: 0
Wrong Answer
time: 201ms
memory: 17848kb
input:
3 100 10000000 999 328 852 537 953 554 506 483 192 443 912 989 346 935 232 652 528 261 899 131 531 81 686 815 543 991 810 576 639 670 572 604 842 546 322 916 97 510 160 238 696 882 214 212 194 102 964 719 255 416 260 687 148 225 664 105 100 913 600 921 203 571 406 752 189 929 716 523 809 666 589 235...
result:
wrong answer too many queries
Subtask #4:
score: 0
Wrong Answer
Test #27:
score: 0
Wrong Answer
time: 196ms
memory: 18944kb
input:
4 100 10000000 999 710 227 715 954 623 585 538 236 363 913 540 3 897 998 726 919 976 843 796 69 415 705 647 707 201 696 993 545 325 375 47 260 490 385 828 162 29 278 867 593 395 219 178 518 999 685 307 772 224 187 557 89 575 524 1 157 230 341 708 978 473 995 15 179 743 416 263 640 4 851 520 719 679 ...
result:
wrong answer too many queries
Subtask #5:
score: 0
Runtime Error
Test #47:
score: 0
Runtime Error
input:
5 100 25000000 49999 3753 28650 36024 8322 47241 9061 43764 6338 45160 16765 40294 43358 37214 37535 38561 1997 7478 9543 11661 1953 7391 41171 43559 9981 24218 13155 22152 45216 30123 1843 20703 23601 42707 6449 40356 3761 32284 34584 32674 44391 41031 324 14845 6935 37071 38330 48041 1824 41182 46...
result:
Subtask #6:
score: 0
Runtime Error
Test #52:
score: 0
Runtime Error
input:
6 100 40000000 9999 3929 7460 4617 7377 498 7572 4628 3661 2404 9179 755 4076 8531 6581 1929 9419 1498 4402 6412 712 4918 2628 798 6283 9427 9775 1472 5554 2146 9972 5228 5459 8417 6778 3121 7649 1031 7691 6270 2238 4885 6121 2099 3435 4615 9962 6384 8809 9169 4553 66 1939 8589 2029 4897 7334 2867 8...
result:
Subtask #7:
score: 0
Runtime Error
Test #72:
score: 0
Runtime Error
input:
7 50 40000000 29999 12447 18709 13054 17585 8337 14953 7985 1930 24383 1787 2543 26860 12198 2842 14256 8665 17034 6429 14773 8646 27093 6362 29357 18001 10667 8445 6671 21435 27163 14604 19875 745 20772 6696 16391 15560 16789 10983 6199 23133 13 13688 14547 8390 4398 21653 14460 690 24385 5358 2213...
result:
Subtask #8:
score: 0
Runtime Error
Test #92:
score: 0
Runtime Error
input:
8 100 50000000 29999 8375 16777 16700 20953 11899 14682 20874 25860 28858 23241 5089 8044 25448 17746 5605 3087 9145 20179 1080 22944 27383 8384 19943 15371 27572 7882 23028 10474 18744 20202 15687 17001 7543 18709 23165 15713 17032 29011 22353 17455 26045 3484 20330 15159 21274 382 23927 20114 6303...