QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#310574 | #4131. 泉 | blln | 16 | 234ms | 62900kb | C++14 | 999b | 2024-01-21 15:42:34 | 2024-01-21 15:42:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long long n,m,A[8],B[8],Ans=0;
struct xty{
int a[10];
bool operator<(const xty &t)const{
for(int i=1;i<=6;i++)if(a[i]!=t.a[i])return a[i]<t.a[i];
return false;
}
}k;
map<xty,int>Tr[65];
void Add_change(int x,int y,int s,xty t){//,printf("*\n")printf("%d %d\n",x,y);for(int i=1;i<=6;i++)printf("%lld ",t.a[i]);printf(":%d %d\n",y,s);
if(x>6){if(!Tr[s].count(t))Tr[s][t]=1;else{A[y]+=Tr[s][t];Tr[s][t]++;}return;}
t.a[x]=0;Add_change(x+1,y,s<<1,t);t.a[x]=B[x];Add_change(x+1,y+1,(s<<1)|1,t);
}
int C(int x,int y){
int s=1;
for(int i=x;i<=y;i++)s*=i;
return s;
}
int main(){
scanf("%lld %lld",&n,&m);
for(int i=1;i<=n;i++){for(int j=1;j<=6;j++)scanf("%d",&B[j]);Add_change(1,0,0,k);}
// for(int i=m,v=1,V=1;i<=6;i++,v=-v,V^=3)Ans+=A[i]*v*V;
Ans=A[m];for(int i=m+1;i<=6;i++)Ans-=A[i]*C(m,i);
// for(int i=0;i<=6;i++)printf("%lld ",A[i]);
printf("%lld",Ans);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 20ms
memory: 7928kb
input:
1000 2 18 4 7 1 9 13 12 4 12 7 8 5 9 9 10 8 7 3 15 18 14 12 15 11 8 5 5 9 12 1 1 10 10 12 10 6 7 15 10 14 14 16 5 8 10 17 14 15 15 2 13 3 8 5 12 7 8 4 9 9 14 5 16 18 5 8 6 3 5 17 10 18 1 12 5 12 11 1 4 18 16 2 7 14 16 14 11 10 13 11 6 6 17 10 3 8 8 16 7 12 3 9 11 18 18 9 3 18 3 11 5 10 18 6 8 18 14 ...
output:
10800
result:
wrong answer 1st lines differ - expected: '18621', found: '10800'
Test #2:
score: 0
Wrong Answer
time: 16ms
memory: 8124kb
input:
1000 1 8 13 14 5 11 16 14 1 4 17 12 3 11 10 14 16 4 10 16 15 9 12 7 11 12 11 3 3 2 6 14 12 17 6 3 18 1 4 2 12 15 5 17 10 17 11 8 2 3 10 8 17 1 1 12 12 12 3 4 6 4 5 8 6 13 11 16 13 11 18 3 12 16 8 7 7 7 3 4 6 13 14 8 7 5 6 3 9 8 6 3 11 11 9 5 14 2 16 3 13 7 13 2 7 16 18 14 5 5 10 4 2 9 2 16 1 15 10 1...
output:
108085
result:
wrong answer 1st lines differ - expected: '125181', found: '108085'
Test #3:
score: 0
Wrong Answer
time: 9ms
memory: 6928kb
input:
1000 4 2 1 2 2 1 2 1 1 1 1 2 1 2 2 2 2 2 1 1 2 2 2 1 2 1 1 2 1 2 1 2 1 1 2 1 2 2 2 1 1 2 2 2 1 2 1 2 2 2 1 1 2 1 2 2 1 2 1 1 2 2 1 1 1 1 2 1 1 2 2 2 2 1 2 1 1 2 2 1 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 1 2 2 2 2 2 2 1 2 2 1 2 2 1 2 1 1 2 2 2 2 1 1 2 1 2 2 2 1 1 1 1 2 2 2 1 1 2 1 2 1 2 2 1 1 2 2 1 1...
output:
-560433
result:
wrong answer 1st lines differ - expected: '29322', found: '-560433'
Test #4:
score: 4
Accepted
time: 15ms
memory: 9620kb
input:
1000 3 714 860 426 502 983 796 992 479 592 369 806 984 447 522 365 809 609 409 359 314 626 940 961 719 661 185 83 398 399 9 728 782 501 560 2 823 517 886 799 363 315 730 702 267 311 314 202 751 355 862 529 366 651 151 951 648 430 976 66 993 521 119 969 744 1000 120 126 765 868 511 82 118 522 591 163...
output:
0
result:
ok single line: '0'
Test #5:
score: 4
Accepted
time: 194ms
memory: 36336kb
input:
10000 6 1 5 3 3 2 2 4 3 4 3 3 1 5 1 4 4 5 2 2 1 3 5 4 2 4 2 2 3 1 2 4 3 5 1 2 2 5 2 2 1 5 2 3 3 4 4 3 1 5 5 4 5 1 2 4 1 1 5 1 2 3 5 3 5 4 5 2 5 3 1 5 5 5 3 1 4 5 1 2 1 2 1 4 4 2 3 5 5 2 1 5 3 2 5 1 4 3 1 1 4 5 3 2 3 4 3 3 5 1 1 1 3 4 2 5 5 2 5 3 4 2 4 1 1 4 3 2 5 1 4 5 3 1 4 2 2 5 4 5 3 3 5 3 1 4 2 ...
output:
779
result:
ok single line: '779'
Test #6:
score: 0
Wrong Answer
time: 226ms
memory: 44132kb
input:
10000 5 9 8 10 4 2 6 10 3 1 4 10 10 6 4 9 6 7 3 9 6 5 3 2 7 9 9 10 4 6 8 2 7 2 2 9 9 8 2 1 10 10 9 9 5 5 9 8 4 8 7 4 6 8 5 2 9 1 5 5 10 6 4 3 7 5 5 6 7 8 1 5 4 9 7 1 9 10 4 6 9 1 9 6 9 2 7 1 3 6 10 1 10 2 3 5 8 5 7 5 2 7 4 4 4 10 6 6 7 8 8 3 1 2 8 8 10 3 3 6 2 8 9 4 5 4 2 3 5 4 2 1 7 5 4 3 6 1 4 7 2...
output:
249
result:
wrong answer 1st lines differ - expected: '657', found: '249'
Test #7:
score: 0
Wrong Answer
time: 234ms
memory: 58700kb
input:
10000 3 50 86 6 44 27 3 17 76 76 10 39 22 90 11 26 84 43 40 53 34 6 22 3 73 30 85 77 93 86 97 51 82 10 94 91 38 70 9 45 48 31 5 39 44 65 27 12 92 18 9 67 14 15 12 59 13 72 65 72 83 84 11 25 5 23 46 95 41 98 69 97 5 80 79 53 29 89 82 70 45 53 55 53 35 61 58 32 18 28 55 20 17 39 9 100 90 78 54 89 76 3...
output:
224
result:
wrong answer 1st lines differ - expected: '248', found: '224'
Test #8:
score: 4
Accepted
time: 233ms
memory: 58472kb
input:
10000 4 60 74 22 2 91 4 54 20 39 51 70 79 79 38 99 43 79 85 27 47 62 26 95 22 24 2 42 71 12 60 60 1 28 59 84 2 36 49 28 59 100 34 67 61 37 10 90 73 59 82 97 1 94 39 69 32 72 43 34 26 95 31 28 62 9 38 63 90 34 4 83 21 88 62 68 37 13 99 65 42 80 27 10 64 56 65 36 75 86 71 4 4 62 82 17 15 69 11 83 56 6...
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Wrong Answer
time: 222ms
memory: 60704kb
input:
10000 2 508 426 290 468 958 541 582 591 470 620 125 388 636 726 546 160 852 757 989 5 187 777 424 189 996 395 925 129 682 24 86 391 789 233 342 969 152 623 234 410 640 32 86 586 156 159 352 932 934 101 402 324 862 282 28 564 506 906 497 379 413 467 208 534 417 48 523 50 385 477 367 946 619 77 345 69...
output:
184
result:
wrong answer 1st lines differ - expected: '1919100', found: '184'
Test #10:
score: 4
Accepted
time: 173ms
memory: 62376kb
input:
10000 1 3854 9797 3860 2281 5351 6602 383 5088 2628 9448 7260 380 6197 800 9536 6827 1929 2501 2449 5383 8517 3329 2353 1543 221 6067 7276 6501 5926 1551 1449 8764 7629 9763 1375 6969 4302 2870 1979 9953 1299 7375 7851 9836 1203 8589 4334 280 3278 7442 6640 3650 2149 4802 4768 7163 1947 1756 979 437...
output:
7455
result:
ok single line: '7455'
Test #11:
score: 0
Wrong Answer
time: 176ms
memory: 62900kb
input:
10000 0 5026060 5377234 6965009 3580664 8452094 9124584 3779631 7002512 9342425 9987060 4616565 8897611 1403250 8134088 6529717 1396814 9302916 9585064 8559552 8332756 3452878 1352388 8512845 4713423 7877191 5348925 448171 1522202 9595409 4693345 9742186 9866527 68752 6424727 997999 4544163 565983 1...
output:
49995000
result:
wrong answer 1st lines differ - expected: '49994986', found: '49995000'
Test #12:
score: 0
Time Limit Exceeded
input:
100000 4 16 4 2 7 3 4 8 5 8 14 9 12 15 1 18 8 8 9 18 14 15 4 1 16 12 14 11 11 8 14 14 2 18 14 15 2 1 8 3 17 18 9 15 12 6 8 11 2 9 3 17 8 15 10 12 8 1 12 1 2 13 11 14 15 8 1 2 18 18 5 16 7 4 9 4 4 18 14 3 9 4 7 14 12 1 6 18 5 3 1 3 17 12 11 11 6 3 12 9 10 15 3 11 18 4 3 15 18 14 14 16 1 16 3 12 10 17...
output:
result:
Test #13:
score: 0
Time Limit Exceeded
input:
100000 2 18 3 11 18 8 18 6 14 10 1 8 15 17 2 13 6 16 14 10 15 16 2 16 12 6 16 6 18 16 17 10 10 13 13 7 12 10 6 2 15 13 12 4 17 16 12 11 13 15 15 4 10 15 18 10 16 16 15 8 13 5 10 13 8 1 2 3 10 18 12 5 4 12 10 14 12 9 13 17 10 11 8 9 8 6 18 12 5 18 14 3 3 8 12 16 16 7 8 9 11 14 15 1 6 8 13 18 17 7 10 ...
output:
result:
Test #14:
score: 0
Time Limit Exceeded
input:
100000 5 14 1 17 15 5 12 1 14 5 3 15 8 14 13 10 17 17 2 14 4 5 9 13 3 14 9 9 6 5 10 18 16 6 7 13 6 14 6 1 7 17 11 1 11 3 9 18 14 6 6 13 9 1 13 13 10 10 2 5 11 5 15 10 9 17 2 18 18 9 9 5 7 4 11 13 17 1 15 16 12 14 12 7 16 1 13 12 14 15 18 1 15 9 2 18 12 4 16 10 1 9 6 18 5 6 8 16 3 6 9 11 4 13 18 8 13...
output:
result:
Test #15:
score: 0
Time Limit Exceeded
input:
100000 3 6 4 13 8 7 17 18 11 13 16 2 12 10 5 18 10 9 14 14 18 5 13 13 14 2 3 6 6 4 16 9 10 18 11 4 1 3 17 8 13 2 16 9 2 15 5 1 14 17 13 5 1 15 8 8 5 8 7 1 14 6 5 9 3 4 6 3 14 2 6 17 9 16 8 10 10 18 8 10 11 17 4 4 6 13 16 15 15 15 11 6 10 11 13 17 4 4 9 5 8 7 6 10 8 16 10 13 8 14 16 4 12 17 6 7 1 15 ...
output:
result:
Test #16:
score: 0
Time Limit Exceeded
input:
100000 6 10 15 5 6 14 16 14 3 6 10 7 15 11 8 16 1 4 15 1 14 11 6 14 4 4 5 18 4 16 7 6 1 9 3 11 8 15 2 18 15 6 15 16 2 17 12 4 12 7 2 1 7 15 5 9 17 17 4 12 15 4 15 4 16 17 14 15 15 13 8 7 14 14 9 9 9 7 16 14 3 5 10 1 17 5 2 10 18 17 12 15 4 10 6 3 2 7 5 12 18 11 5 6 14 2 17 14 17 5 11 18 18 10 13 3 1...
output:
result:
Test #17:
score: 0
Time Limit Exceeded
input:
100000 1 7 15 14 2 10 5 8 12 12 17 12 6 6 1 17 2 1 4 18 8 13 1 1 1 5 3 7 18 4 11 3 13 14 8 9 13 4 18 14 12 12 10 9 16 3 1 2 1 13 11 8 10 18 2 10 17 6 15 14 1 18 13 18 17 15 16 11 4 6 7 7 14 7 5 8 6 11 3 12 9 17 4 14 9 9 6 3 10 11 15 16 4 15 18 14 17 2 7 5 12 13 5 6 16 15 16 14 6 13 11 18 2 2 6 2 1 4...
output:
result:
Test #18:
score: 0
Time Limit Exceeded
input:
100000 5 2 5 2 3 3 3 5 5 1 2 4 1 5 4 3 2 4 1 2 3 5 2 1 4 5 2 3 4 5 4 5 2 2 5 4 1 5 5 4 4 2 2 2 2 4 4 5 5 2 1 4 1 5 3 2 4 5 2 5 5 2 2 4 5 2 5 1 2 4 1 5 3 5 4 5 1 2 4 5 3 3 2 2 1 3 2 4 1 5 3 4 3 4 5 3 1 1 1 2 2 1 2 1 1 5 1 1 2 1 2 4 1 5 4 3 4 5 3 2 1 1 2 3 3 3 1 5 4 2 4 5 1 3 4 3 1 4 4 2 5 3 1 5 1 5 2...
output:
result:
Test #19:
score: 0
Time Limit Exceeded
input:
100000 6 3 1 1 1 3 1 1 1 2 2 1 2 2 1 1 3 1 3 2 1 2 1 3 2 1 3 3 2 3 1 1 2 1 3 3 2 1 1 3 1 1 1 1 2 1 2 1 1 2 2 2 2 2 1 1 2 1 3 2 2 2 2 1 1 1 2 1 3 1 2 3 2 1 1 2 3 1 1 3 3 3 3 3 3 1 1 1 3 2 2 2 2 1 3 2 2 3 1 2 1 3 2 2 2 2 3 2 3 1 3 3 1 1 2 2 2 2 1 1 2 3 3 1 2 3 1 3 1 3 2 2 3 2 3 2 1 1 1 3 3 1 2 2 1 1 3...
output:
result:
Test #20:
score: 0
Time Limit Exceeded
input:
100000 4 8 4 5 4 6 8 8 7 9 7 5 4 1 4 10 6 8 1 4 5 10 10 9 9 3 8 6 6 1 2 6 3 6 8 3 6 9 10 7 7 3 10 6 4 5 8 6 1 9 9 2 3 4 2 10 9 5 3 10 9 3 3 6 4 5 10 3 4 6 3 7 6 8 7 1 2 9 5 9 5 6 3 6 5 8 6 8 1 6 10 10 4 6 5 2 1 2 1 4 3 8 3 5 7 3 5 5 9 2 10 1 8 4 6 4 1 9 3 5 9 2 7 10 2 2 10 8 5 2 5 1 4 6 6 8 10 2 8 7...
output:
result:
Test #21:
score: 0
Time Limit Exceeded
input:
100000 2 100 13 98 36 50 14 24 6 66 2 79 4 80 53 87 25 88 46 50 28 10 63 5 22 54 28 96 33 78 28 29 85 78 66 85 69 6 12 19 11 74 50 56 58 26 45 40 29 99 74 32 52 43 14 66 89 91 38 15 36 69 54 43 97 11 83 10 51 70 14 41 83 63 34 49 73 63 23 30 79 4 62 52 90 65 48 39 75 44 92 18 16 20 60 68 34 34 38 34...
output:
result:
Test #22:
score: 0
Time Limit Exceeded
input:
100000 3 47 11 78 37 95 12 25 25 75 6 54 64 84 65 76 77 99 22 47 19 2 77 28 75 79 30 65 10 89 18 88 98 6 88 53 53 16 90 99 91 47 13 45 51 53 79 63 40 52 33 85 58 67 87 36 46 96 92 49 47 23 44 82 80 1 79 45 51 26 2 69 26 74 100 75 74 64 85 78 45 70 45 78 100 81 93 83 66 13 79 74 66 35 39 72 90 22 48 ...
output:
result:
Test #23:
score: 0
Time Limit Exceeded
input:
100000 3 11 10 67 70 98 71 16 44 88 74 41 81 32 94 99 31 68 70 81 61 47 73 65 26 100 81 3 22 38 70 53 78 30 31 29 66 51 42 60 38 57 89 55 65 27 48 40 86 73 83 68 99 32 90 48 99 84 63 70 56 57 51 50 91 26 21 17 99 51 96 64 54 70 75 75 52 19 65 44 73 94 89 60 14 7 25 18 58 45 31 68 8 34 73 78 41 28 50...
output:
result:
Test #24:
score: 0
Time Limit Exceeded
input:
100000 1 45 636 561 612 622 642 3 918 929 994 205 898 709 365 309 633 683 323 120 800 576 497 838 488 80 32 819 605 649 375 371 71 738 767 271 548 71 63 144 921 657 561 598 648 748 845 676 316 294 893 721 259 825 234 406 535 601 599 159 55 187 759 822 994 127 282 445 670 980 536 786 122 166 287 562 ...
output:
result:
Test #25:
score: 0
Time Limit Exceeded
input:
100000 0 15131 56341 34129 76122 48849 31821 66673 54895 78300 90230 18128 10410 71224 83757 86968 8514 42071 32574 17699 60176 16026 92022 8748 46794 42503 46068 65232 32160 11519 62365 82589 15985 65143 31694 60881 27850 33902 1830 92333 79015 69565 6874 78951 46819 38374 61678 14580 84927 43962 5...