QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#68612 | #4888. Decoding The Message | 275307894a | TL | 807ms | 3808kb | C++14 | 2.1kb | 2022-12-17 20:19:46 | 2022-12-17 20:19:48 |
Judging History
answer
#include<bits/stdc++.h>
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n))
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define PB push_back
using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned ll;
using namespace std;const int N=257+5,M=10+5,K=1e5+5,mod=1e9+7,Mod=mod-1,INF=2e9+7;const db eps=1e-5;mt19937 rnd(263082);
int n,X[N],Y[N],m,B[N*2],Bh;
ll mpow(ll x,int y,int p){ll Ans=1;while(y) y&1&&(Ans=Ans*x%p),y>>=1,x=x*x%p;return Ans;}
int GS(int p){
int Ct=0,i;for(i=1;i<=n;i++) Ct=(Ct+1ll*X[i]*Y[i])%p;if(!Ct) return 0;
ll Ans=1;for(i=1;Ans&&i<=m;i++) Ans=Ans*i%(p-1);return mpow(Ct,Ans,p);
}
bitset<N> f[N],g[N],Cl;
int CK(){
int Mx=0,i,j,h;for(i=1;i<=n;i++) Mx=max(Mx,Y[i]);if(m>=514&&m-Mx>=257) return 1;
Bh=0;for(i=1;i<=n;i++) if(Y[i]==Mx){Mx=0;}else for(j=1;j<=Y[i];j++) B[++Bh]=X[i];
for(i=0;i<=257;i++) f[i]=Cl;f[0][0]=1;
for(i=1;i<=Bh;i++){
for(j=0;j<=min(Bh,m/2);j++) g[j]=f[j],f[j]=Cl;
for(j=0;j<=min(Bh,m/2);j++){
for(h=0;h<257;h++) if(g[j][h]) f[j][(h+B[i])%257]=1,f[j+1][(h-B[i]+257)%257]=1;
}
}
for(i=1;i<=n;i++)Mx=max(Mx,Y[i]);for(i=1;i<=n;i++) if(Y[i]==Mx){
for(j=max(0,m/2-Bh);j<=min(m/2,Y[i]);j++) if(f[m/2-j][(1ll*(2*j-Y[i])*X[i]%257+257)%257]) return 1;
return 0;
}
}
int GA(){
if(CK()) return 0;if(m>=12) return 1;
int i,j;Bh=0;for(i=1;i<=n;i++) for(j=1;j<=Y[i];j++) B[++Bh]=X[i];
ll As=1;for(i=0;i<(1<<m);i++){
int Ct=0;for(j=0;j<m;j++) Ct+=(i>>j&1);if(Ct^(m/2)) continue;
int Ts=0;for(j=1;j<=m;j++) Ts+=(i>>(j-1)&1?-B[j]:B[j]);As=As*(Ts%257+257)%257;
}
ll Fc=1;for(i=1;i<=m/2;i++) Fc=Fc*i%256;for(i=1;i<=(m+1)/2;i++) Fc=Fc*i%256;return mpow(As,Fc,257);
}
void Solve(){
int i,j;scanf("%d",&n);m=0;for(i=1;i<=n;i++) scanf("%d%d",&X[i],&Y[i]),m+=Y[i];
int A1=GS(3),A2=GS(5),A3=GS(17),A4=GA();
for(i=0;i<65535;i++) if(i%3==A1&&i%5==A2&&i%17==A3&&i%257==A4) {printf("%d\n",i);return;}
}
int main(){
int t;scanf("%d",&t);while(t--) Solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3796kb
input:
5 1 42 1 2 0 1 1 1 1 239 2 2 1 1 2 1 3 1 1 2 2 3 2
output:
42 256 514 1284 61726
result:
ok 5 number(s): "42 256 514 1284 61726"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
100 1 213 79 1 54 69 1 218 55 1 248 80 1 101 8 1 153 79 1 240 45 1 112 70 1 217 5 1 208 64 1 48 30 1 0 19 1 53 40 1 63 17 1 179 65 1 221 22 1 135 84 1 138 20 1 54 29 1 114 19 1 253 94 1 240 36 1 40 94 1 244 93 1 239 24 1 133 8 1 105 91 1 45 43 1 241 74 1 206 17 1 100 73 1 133 44 1 57 70 1 56 72 1 47...
output:
21846 21846 26215 59110 32896 6426 48060 59110 43570 32896 15420 0 59110 6426 26215 17476 15420 15420 21846 21846 32896 15420 59110 21846 54741 32896 48060 48060 32896 50116 26215 32896 15420 54741 6426 17476 15420 21846 54741 39321 54741 54741 6426 54741 1 59110 59110 26215 54741 15420 15420 22101 ...
result:
ok 100 numbers
Test #3:
score: 0
Accepted
time: 5ms
memory: 3696kb
input:
100 1 208 74003161 1 108 37880052 1 102 289342450 1 190 16254190 1 20 507132853 1 1 842472902 1 212 226854721 1 33 797732105 1 213 114087750 1 128 914592259 1 27 779924279 1 203 425018504 1 217 458915584 1 139 710603120 1 226 84538604 1 50 602470204 1 150 228443262 1 48 593328022 1 24 35949157 1 148...
output:
1 54741 0 59110 26215 32896 1 48060 15420 1 21846 32896 32896 59110 32896 59110 15420 54741 21846 1 54741 26215 54741 32896 32896 54741 0 54741 21846 48060 32896 21846 32896 50116 50116 21846 15420 48060 59110 26215 15420 21846 1 54741 21846 48060 15420 54741 17476 48060 54741 6426 54741 59110 54741...
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 5ms
memory: 3620kb
input:
100 2 14 231169007 169 438746441 1 106 224694504 1 11 18668998 1 94 173751742 1 248 424067991 1 132 301760918 1 192 82611030 1 165 348431335 2 25 205571031 27 312669004 1 244 137616146 2 199 365022194 197 490765328 2 151 270019586 159 158690083 1 169 403261990 1 246 138193758 2 38 426785000 53 20660...
output:
54741 54741 32896 32896 21846 54741 15420 48060 54741 32896 54741 32896 59110 54741 32896 26215 32896 59110 17476 32896 32896 32896 59110 32640 15420 43690 32896 21846 32896 32896 32896 59110 32896 15420 32896 54741 32896 32896 21846 26215 39321 54741 17476 1 32896 21846 48060 32896 32896 32896 1542...
result:
ok 100 numbers
Test #5:
score: 0
Accepted
time: 3ms
memory: 3548kb
input:
100 19 159 4447181 119 4122592 208 20865102 19 18177591 218 15143881 145 22831007 151 35147071 91 49145857 165 13456608 253 18740477 123 40212709 175 10592471 244 41909532 62 34807087 41 14303940 153 1925365 84 46161946 120 19515674 140 39567667 18 36 6939854 219 19270307 107 26811080 135 44704863 1...
output:
32896 15420 32896 59110 32896 54741 59110 1 32896 32896 32896 1 32896 15420 32896 32896 0 32896 15420 32896 15420 32896 32896 32896 32896 21846 32896 32896 54741 54741 59110 32896 32896 32896 32896 32896 32896 32896 54741 54741 32896 43690 32896 32896 32896 32896 17476 32896 59110 15420 32896 59110 ...
result:
ok 100 numbers
Test #6:
score: 0
Accepted
time: 8ms
memory: 3704kb
input:
100 162 143 1143808 192 3810724 189 1037339 105 270668 167 1068188 216 4408992 225 1618501 221 430240 120 3189057 223 2722065 217 1793649 29 3122166 129 249284 245 4125250 89 317643 254 3504072 170 4904459 104 2478836 240 1440277 180 3705854 255 3406356 149 1736411 33 4267429 227 2649591 78 4076525 ...
output:
32896 32896 32896 54741 54741 32896 32896 59110 32896 32896 59110 54741 17476 32896 32896 59110 32896 32896 54741 32896 32896 54741 32896 54741 32896 17476 15420 32896 54741 54741 54741 54741 39321 32896 59110 59110 54741 59110 32896 32896 54741 32896 32896 32896 32896 32896 54741 0 32896 54741 1542...
result:
ok 100 numbers
Test #7:
score: 0
Accepted
time: 6ms
memory: 3628kb
input:
100 2 225 103463954 133 98673573 1 115 229035681 2 72 99532710 56 262010873 1 29 163503969 3 209 190760315 244 3444017 50 194052768 1 64 90518604 3 133 254936162 112 248946806 219 174695931 1 237 93137417 3 151 238090677 19 2534188 145 26960475 3 224 159486758 106 47651522 179 262824676 1 250 540564...
output:
54741 48060 32896 21846 54741 54741 32896 21846 32896 32896 48060 32896 39321 32896 32896 32896 54741 54741 32896 48060 59110 17476 32896 15420 32896 26215 15420 0 32896 32896 15420 32896 32896 32896 54741 54741 48060 15420 15420 59110 32896 32896 32896 32896 32896 54741 21846 32896 54741 1 32896 59...
result:
ok 100 numbers
Test #8:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
100 5 9 31874638 121 25059072 79 135500659 252 5862068 235 95284441 5 93 4009689 251 85715731 161 161993061 85 174911893 33 146760588 5 47 131530698 22 19994334 98 99702159 196 78068211 176 86704392 5 116 34106857 39 148267518 79 165442900 16 114763590 0 161252155 5 174 193371329 124 109104737 185 1...
output:
32896 54741 54741 54741 54741 32896 54741 32896 32896 17476 54741 59110 32896 54741 1 54741 54741 15420 43690 1 32896 32896 39321 32896 21846 32896 32896 54741 32896 54741 32896 32896 15420 32896 43690 15420 32896 54741 32896 32896 59110 54741 39321 54741 54741 32896 54741 32896 54741 32896 32896 59...
result:
ok 100 numbers
Test #9:
score: 0
Accepted
time: 4ms
memory: 3660kb
input:
100 33 44 18869789 117 8369510 145 3544065 144 3664765 168 1365372 85 12860320 150 13537400 53 8130861 91 4951044 63 8583660 110 17817008 94 4597127 255 7812378 14 17438008 129 16276681 186 5448132 2 11721273 74 6179751 181 10738486 49 19672464 98 19560557 190 14484751 225 5605695 135 9185676 156 92...
output:
32896 32896 54741 17476 59110 32896 32896 32896 59110 59110 32896 54741 32896 32896 32896 32896 32896 32896 54741 32896 32896 59110 54741 54741 32896 21846 54741 54741 32896 54741 43690 32896 32896 32896 32896 32896 17476 32896 32896 54741 32896 54741 32896 59110 59110 32896 32896 32896 32896 32896 ...
result:
ok 100 numbers
Test #10:
score: 0
Accepted
time: 6ms
memory: 3560kb
input:
100 9 113 24641456 211 94030371 136 79996041 181 26478413 180 4010900 84 17453960 5 68850072 112 80595759 207 98062006 5 12 37702784 80 70203355 154 27068043 195 8627370 224 36311167 4 86 89385424 124 55291852 174 21271530 52 37177714 5 153 62356676 6 31133088 249 54379427 158 58660757 17 71472808 2...
output:
54741 32896 59110 54741 54741 32896 54741 32896 6426 32896 32896 54741 32896 32896 32896 54741 39321 54741 54741 32896 54741 32896 59110 54741 17476 54741 54741 59110 43690 32896 32896 32896 54741 32896 32896 32896 54741 39321 32896 39321 54741 54741 32896 32896 54741 32896 21846 32896 17476 32896 3...
result:
ok 100 numbers
Test #11:
score: 0
Accepted
time: 7ms
memory: 3744kb
input:
100 49 144 4682405 99 6524578 55 7445296 28 7539543 113 6780302 169 3932842 214 4675084 245 3630237 87 5943524 15 6686127 29 5394734 211 6289135 146 4999318 152 7976657 115 6464846 217 3716932 104 2332998 75 669827 89 1437466 160 9175851 8 3009996 17 4165901 98 7340466 158 9527493 106 6171697 90 754...
output:
54741 54741 54741 54741 32896 32896 54741 32896 32896 54741 17476 32896 32896 54741 32896 32896 59110 32896 59110 32896 59110 32896 59110 54741 32896 32896 59110 32896 59110 54741 54741 32896 32896 32896 32896 32896 54741 32896 59110 32896 32896 32896 32896 32896 32896 32896 59110 54741 32896 32896 ...
result:
ok 100 numbers
Test #12:
score: 0
Accepted
time: 2ms
memory: 3764kb
input:
100 1 223 1 1 21 1 1 192 1 1 239 1 1 167 1 1 137 1 1 99 1 1 164 1 1 84 1 1 189 1 1 184 1 1 166 1 1 242 1 1 112 1 1 112 1 1 244 1 1 49 1 1 127 1 1 22 1 1 58 1 1 152 1 1 49 1 1 221 1 1 61 1 1 228 1 1 29 1 1 217 1 1 136 1 1 87 1 1 72 1 1 167 1 1 123 1 1 42 1 1 178 1 1 116 1 1 193 1 1 85 1 1 178 1 1 61 ...
output:
223 21 192 239 167 137 99 164 84 189 184 166 242 112 112 244 49 127 22 58 152 49 221 61 228 29 217 136 87 72 167 123 42 178 116 193 85 178 61 163 245 147 153 99 168 5 173 17 156 106 182 109 238 122 229 93 156 121 88 5 50 233 104 127 229 122 123 55 198 185 127 29 27 101 106 142 82 113 159 198 185 64 ...
result:
ok 100 numbers
Test #13:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
100 2 212 2 156 1 2 97 1 251 2 1 8 1 1 98 2 2 198 2 29 1 2 94 1 50 2 2 252 2 9 1 1 48 2 2 17 1 42 2 2 86 2 71 1 2 180 2 141 2 1 83 2 1 13 2 2 201 1 112 2 2 182 1 174 1 1 104 2 2 141 1 109 1 1 56 2 2 103 2 253 2 1 65 1 1 59 1 2 4 2 14 1 1 187 1 1 148 1 2 245 2 240 1 1 211 1 2 145 2 243 1 1 37 1 2 29 ...
output:
2665 11236 8 21331 30940 47881 26994 4626 28561 49149 54741 2056 21331 49555 41056 54484 35470 39064 32896 65 59 60454 187 148 18565 211 54799 37 20935 47089 39835 3000 21331 17611 22374 9601 51366 32896 148 4369 216 39064 28270 40411 1260 21331 52495 128 56461 186 15420 12601 76 28270 55501 43165 6...
result:
ok 100 numbers
Test #14:
score: 0
Accepted
time: 5ms
memory: 3624kb
input:
100 2 5 2 24 2 2 51 3 171 3 1 154 3 3 7 3 98 1 232 1 3 87 1 95 1 185 1 1 190 1 3 11 3 77 1 253 1 3 242 2 1 2 247 2 3 152 2 252 2 209 1 3 86 1 223 1 230 3 2 193 2 153 3 2 243 2 196 2 1 39 2 1 98 2 1 193 1 3 175 1 128 3 149 2 3 80 2 236 2 186 3 3 155 3 179 1 6 2 2 110 2 141 2 2 118 2 124 2 3 61 2 120 ...
output:
2056 39441 50199 6561 11824 190 35631 59110 35631 59076 59635 2056 60909 21331 193 15556 44200 48196 32896 32896 26470 39321 125 33916 21846 26215 58566 39064 65289 5 39000 6546 32896 34 160 59076 147 11454 28270 50406 39441 2056 53551 15930 39771 71 58821 25770 61201 15556 39064 28 9154 50661 12850...
result:
ok 100 numbers
Test #15:
score: 0
Accepted
time: 6ms
memory: 3660kb
input:
100 4 36 2 119 1 46 1 213 2 4 127 1 176 1 17 3 156 2 3 103 3 7 3 125 2 3 197 2 207 3 65 1 2 178 3 220 1 3 88 2 39 3 195 2 3 145 2 185 4 222 3 1 54 3 2 131 1 81 4 4 156 1 121 3 222 1 8 1 2 225 1 200 2 3 97 3 119 3 43 4 2 225 1 44 2 1 95 4 4 132 3 115 2 125 1 128 2 3 63 1 220 3 174 2 3 251 3 58 3 139 ...
output:
39576 50661 26470 23580 1036 256 34936 20064 2245 41056 8125 26470 61294 28270 1 8721 22101 41056 15420 32896 54741 256 49216 2056 39321 16576 8026 30856 12850 59110 54741 48060 2056 32896 26470 54741 26470 28 60711 23901 21846 32896 63496 8224 59620 256 48196 52701 59110 48060 52701 32571 1 10140 1...
result:
ok 100 numbers
Test #16:
score: 0
Accepted
time: 6ms
memory: 3764kb
input:
100 2 230 2 33 1 3 101 5 218 5 216 4 4 138 2 50 5 148 5 211 1 1 12 5 3 138 5 101 3 124 2 2 51 2 91 1 5 93 4 167 1 157 4 59 1 138 5 3 229 4 227 1 11 2 5 244 5 165 5 142 5 3 1 200 2 5 67 5 15 2 176 3 122 5 50 2 5 69 4 255 2 24 3 228 4 219 5 4 188 3 209 4 121 3 71 1 1 95 1 5 190 5 162 2 158 2 205 3 180...
output:
20179 1 1 46020 50371 39754 1 58600 32896 1 48060 256 95 48060 42790 21846 1 21846 58275 22101 1 1 21846 256 26215 24090 26215 54741 33406 1 54741 59110 56674 1 21846 1 54741 16576 54741 55266 52701 47 18186 21846 1 218 256 54741 87 8736 1 256 32896 34936 54741 21846 36736 32640 50116 16576 256 3235...
result:
ok 100 numbers
Test #17:
score: 0
Accepted
time: 4ms
memory: 3716kb
input:
100 6 12 2 227 5 7 4 83 4 124 3 230 6 6 138 2 58 6 130 6 165 2 30 4 140 3 2 28 5 224 1 3 192 5 207 5 124 4 6 98 6 68 4 66 2 51 3 149 1 81 2 2 238 3 77 3 4 196 2 222 3 146 3 63 2 3 156 4 188 3 74 6 3 44 5 136 6 24 2 4 149 3 165 5 208 2 30 2 6 216 2 24 4 154 5 230 4 242 3 207 1 2 96 2 40 3 2 30 5 172 ...
output:
32896 54741 24736 32896 32896 23070 256 6426 1 1 32896 29511 21846 1 59110 22101 30720 59110 21846 1 1 1 32896 54741 59110 32896 50625 21846 15420 67 15420 63834 37231 32896 34536 32896 1 26215 1 18496 32896 1 26215 1 15420 26215 22101 25164 14415 26331 17460 110 32896 51 3855 24175 54741 48060 3238...
result:
ok 100 numbers
Test #18:
score: 0
Accepted
time: 7ms
memory: 3552kb
input:
100 2 101 2 6 6 2 221 2 2 2 6 90 2 9 3 1 5 34 6 250 4 119 3 5 162 4 154 7 10 4 146 2 254 5 4 209 6 249 1 77 2 25 2 2 129 1 148 3 2 93 6 191 3 5 252 5 56 2 157 7 173 6 202 2 1 228 5 2 169 7 202 1 5 240 6 227 3 38 5 166 3 74 5 2 0 1 127 7 7 254 7 84 1 10 1 5 7 3 3 243 3 0 6 4 35 3 143 1 215 5 169 6 7 ...
output:
17476 32896 54741 32896 21846 58581 21846 1 16440 26470 17476 256 26215 21846 54741 21846 32896 15846 1 32896 54996 22101 1 21846 32896 54741 21846 50116 17476 47166 32896 59110 15420 32896 8481 54741 28270 14400 1 32896 32896 32896 39321 1 32896 26215 1 48060 114 32896 54741 26215 1 21846 48060 328...
result:
ok 100 numbers
Test #19:
score: 0
Accepted
time: 15ms
memory: 3548kb
input:
100 4 46 6 4 1 186 6 37 2 7 166 7 50 3 115 4 7 7 147 1 174 2 116 6 5 186 1 26 3 228 4 158 2 130 3 8 140 6 112 1 153 3 60 7 122 5 63 7 157 6 237 8 1 181 8 1 134 6 3 133 2 22 6 246 2 3 183 6 236 7 91 6 5 155 7 118 6 175 5 195 1 48 5 6 174 5 218 2 96 8 82 1 113 3 93 6 8 73 5 217 4 213 6 65 1 237 7 132 ...
output:
48060 54741 32896 59110 32896 54741 59110 1 1 32896 54741 15420 58821 32896 17476 1 50116 54741 1 32896 48060 1 32896 1 32896 39201 32896 59110 48060 32896 32896 1 32896 32896 54741 1 1 1 32896 21846 54741 59110 59110 21846 54741 17476 11185 54741 32896 59110 32896 59110 54741 1 256 21846 32896 4806...
result:
ok 100 numbers
Test #20:
score: 0
Accepted
time: 23ms
memory: 3628kb
input:
100 4 35 1 60 5 139 2 150 5 4 173 1 110 6 64 3 208 4 9 152 8 96 7 46 2 51 9 81 6 108 7 199 9 99 6 208 8 6 80 5 18 3 221 6 124 3 31 2 252 8 3 203 2 205 3 114 7 6 176 8 86 4 205 8 239 6 41 2 118 3 9 203 8 215 2 85 2 14 4 148 7 171 5 213 8 155 7 76 9 5 173 7 159 7 185 2 209 5 230 6 6 168 3 130 8 135 2 ...
output:
32896 21846 59110 15420 50116 54741 54741 32896 32896 54741 59110 32896 1 32896 32896 15420 54741 54741 21846 50116 32896 32896 32896 32896 32896 32896 54741 32896 1 1 59110 15420 21846 32896 54741 26215 59110 1 32896 32896 50116 41056 45610 15420 54741 54741 32896 32896 1 1 54741 32896 21846 32896 ...
result:
ok 100 numbers
Test #21:
score: 0
Accepted
time: 5ms
memory: 3552kb
input:
100 3 207 8 211 7 117 8 5 156 7 215 8 170 4 164 9 161 1 2 54 3 32 3 1 85 1 5 119 5 221 8 124 1 194 10 197 9 3 106 4 95 7 166 9 3 7 2 159 5 31 5 5 126 4 194 3 135 8 255 10 113 6 3 161 5 1 2 5 5 1 52 2 5 87 3 231 4 76 10 210 8 67 8 2 225 1 49 4 4 209 4 18 6 27 7 31 5 3 135 8 29 3 204 7 2 24 10 131 8 5...
output:
1 32896 6546 85 59110 54741 1 54741 1 13621 54741 33151 1 48060 32896 15420 15420 54741 54741 1 21846 26215 1 21846 1 32896 54741 1 1 1 54741 112 1 1 54741 32896 1 18834 54741 1 31876 1 59110 21846 56781 32896 26215 62901 5526 54741 1 21846 154 32896 54741 23901 48060 1 22101 36040 26215 25186 1 218...
result:
ok 100 numbers
Test #22:
score: 0
Accepted
time: 17ms
memory: 3580kb
input:
100 2 241 1 199 1 3 54 13 55 1 5 4 4 224 18 188 7 199 7 104 10 4 201 6 9 4 245 4 10 11 5 65 3 151 11 195 12 143 14 39 1 2 254 9 191 15 4 23 14 77 15 97 5 89 13 1 1 6 1 131 19 2 237 7 136 20 4 220 1 210 13 64 15 116 12 4 183 4 20 7 160 13 64 5 5 96 18 12 1 123 2 105 20 221 1 4 192 11 98 6 227 14 186 ...
output:
2605 21846 32896 1 54741 6426 32896 54741 1 1 32896 1 1 1 1 1 1 1 15420 54741 26215 32896 14230 32896 21846 32896 1 54741 54741 54741 1 32896 48060 1 32896 32896 21846 17476 32896 1 33151 21846 32640 26215 59110 54741 32896 32640 21846 32896 48060 59110 32896 59110 32896 1 1 54741 32896 60 1 32896 1...
result:
ok 100 numbers
Test #23:
score: 0
Accepted
time: 327ms
memory: 3584kb
input:
100 1 251 80 3 82 93 244 48 154 90 4 75 51 168 24 146 86 1 34 2 134 57 200 63 3 2 79 23 51 182 82 1 250 1 5 123 89 15 28 189 12 237 19 140 21 3 112 51 124 64 8 74 2 128 60 204 49 2 148 99 37 62 1 153 91 5 77 50 145 2 55 81 106 53 52 85 4 236 13 165 29 79 20 202 77 2 203 23 96 88 2 148 58 186 70 3 14...
output:
59110 54741 32896 21846 59110 250 54741 59110 21846 1 6426 54741 54741 1 32896 32896 32896 32896 54741 32896 1 32896 32896 32896 21846 26215 21846 32896 15420 32896 54741 32896 32896 32896 32896 32896 15420 32896 32896 59110 1 32896 1 32896 54741 32896 32896 59110 32896 32896 54741 54741 54741 32896...
result:
ok 100 numbers
Test #24:
score: 0
Accepted
time: 25ms
memory: 3624kb
input:
100 4 180 10 38 3 246 7 223 3 8 224 8 214 5 4 2 132 10 118 8 187 2 141 5 210 8 6 50 7 214 5 150 9 124 4 11 9 87 5 7 30 1 230 6 255 3 68 8 89 3 221 7 4 9 3 190 2 248 4 164 2 2 200 2 188 7 7 132 7 18 2 254 6 16 6 152 10 116 10 164 1 9 239 9 18 4 156 5 223 10 139 3 134 8 145 1 51 2 45 6 4 140 5 87 2 41...
output:
48060 54741 59110 54741 43690 21846 54741 54741 21846 59110 32896 32896 43690 32896 21846 21846 256 32896 32896 54741 54741 32896 54741 1 32896 30856 15420 1 32896 21846 32896 54741 32896 59110 32896 32896 59110 54741 54741 26470 21846 15420 54741 32896 21846 32896 54741 54741 32896 54741 17476 1 0 ...
result:
ok 100 numbers
Test #25:
score: 0
Accepted
time: 3ms
memory: 3760kb
input:
100 9 71 1 219 1 235 1 137 1 211 1 40 1 179 1 107 1 135 1 10 180 1 212 1 165 1 77 1 249 1 19 1 149 1 174 1 218 1 117 1 5 0 1 105 1 242 1 153 1 253 1 10 201 1 31 1 169 1 208 1 149 1 250 1 209 1 133 1 212 1 173 1 8 236 1 204 1 234 1 135 1 197 1 1 1 104 1 170 1 6 146 1 34 1 235 1 237 1 210 1 161 1 6 72...
output:
30856 48315 54756 26215 21846 50406 63751 50371 63751 111 33916 19729 32896 54741 2041 12595 61981 31176 8601 155 17511 441 6561 32641 9895 256 176 63615 58921 40546 50511 22101 8190 22101 24411 256 21846 32896 19396 50406 47481 54741 41056 24736 29290 24190 55266 99 48060 32895 21846 6681 114 1 130...
result:
ok 100 numbers
Test #26:
score: 0
Accepted
time: 6ms
memory: 3808kb
input:
100 9 42 1 35 2 16 1 230 2 106 1 148 2 105 1 81 2 238 2 6 164 2 83 2 45 1 190 1 248 2 209 2 8 85 2 194 2 199 1 90 1 205 1 68 1 201 1 115 1 4 196 1 125 2 177 2 218 1 1 49 2 6 25 1 182 1 242 2 254 2 80 2 114 1 1 148 2 10 140 1 109 2 168 2 201 1 77 2 233 2 219 1 82 1 11 2 228 1 5 87 2 18 1 235 2 54 2 1...
output:
1 1 1 256 54484 22101 52171 32896 21846 2056 50 33406 256 32896 43369 21846 1 256 34795 61150 52701 54741 4096 37231 1 9766 32896 33151 256 31611 54741 17476 172 56356 21846 30856 32896 256 15556 21846 9210 30856 1 10795 58666 256 33924 36976 32896 30856 59110 32896 21846 26535 17341 32896 204 52701...
result:
ok 100 numbers
Test #27:
score: 0
Accepted
time: 9ms
memory: 3636kb
input:
100 5 217 1 34 1 28 1 130 3 220 1 3 147 3 40 2 241 2 7 137 3 19 3 185 1 88 1 151 2 202 2 48 2 10 128 3 168 2 233 3 167 3 221 2 249 2 138 3 190 3 53 2 58 3 3 14 3 113 2 57 2 2 236 3 217 3 7 167 1 38 1 173 3 114 1 124 3 14 3 122 1 1 164 1 9 64 3 122 2 29 3 34 2 52 2 227 3 185 1 127 1 198 3 7 126 1 233...
output:
16576 19516 32896 32896 256 46071 54741 164 32896 1 32896 256 256 32896 54741 32896 54741 22101 6426 59 32896 26215 32896 32896 32896 32896 19806 32896 32896 56686 50371 15420 54741 33406 54741 30856 1 22101 54741 59110 54741 48316 21846 1801 32896 33916 36721 15420 32896 2056 54741 256 32640 53721 ...
result:
ok 100 numbers
Test #28:
score: 0
Accepted
time: 10ms
memory: 3760kb
input:
100 19 0 1 56 1 211 1 104 1 196 1 63 1 246 1 7 1 102 1 85 1 45 1 64 1 84 1 195 1 197 1 217 1 65 1 159 1 50 1 13 112 1 220 1 228 1 38 1 66 1 103 1 69 1 90 1 76 1 157 1 12 1 113 1 106 1 5 91 1 30 1 251 1 206 1 200 1 16 181 1 74 1 225 1 36 1 58 1 68 1 95 1 101 1 152 1 141 1 13 1 78 1 179 1 110 1 70 1 8...
output:
32896 59110 256 32896 59110 59110 33916 13174 54741 26215 52411 32896 52701 32896 54741 59110 50116 54741 2311 17476 1 26215 32896 1 59110 60654 15420 45 32896 75 22101 24736 32896 32896 36976 158 57375 54741 32911 59110 32896 54996 15420 32896 32896 59110 109 32896 54741 32896 32896 61981 32896 433...
result:
ok 100 numbers
Test #29:
score: 0
Accepted
time: 126ms
memory: 3620kb
input:
100 20 20 2 43 9 128 7 171 7 153 8 169 3 209 7 92 10 5 9 74 5 191 5 131 10 79 5 140 1 194 3 68 1 185 1 184 1 14 4 242 4 7 154 9 15 1 7 9 126 7 32 7 225 4 22 5 6 24 7 175 2 228 4 25 9 139 3 84 9 16 162 2 237 10 161 5 15 4 67 4 81 9 134 5 158 5 97 9 191 5 202 9 7 2 163 1 41 2 59 1 151 5 5 250 8 249 5 ...
output:
54741 59110 32896 59110 32896 32896 54741 54741 26215 32896 43690 59110 32896 32896 59110 32896 54741 15420 32896 15420 32896 59110 32896 1 32896 32896 32896 54741 15420 54741 59110 48060 54741 59110 54741 32896 54741 21846 54741 32896 54741 54741 21846 32896 42790 32896 54741 1 1 21846 1 32896 5474...
result:
ok 100 numbers
Test #30:
score: 0
Accepted
time: 348ms
memory: 3764kb
input:
100 3 70 4 145 5 64 5 28 5 6 0 8 113 7 228 1 242 1 121 9 214 6 238 7 243 5 159 6 4 5 253 1 161 5 104 6 75 8 92 6 144 1 132 9 17 2 10 10 179 9 41 8 206 10 222 7 6 6 77 10 197 6 162 5 17 240 3 216 8 200 2 2 10 55 9 96 1 23 5 107 4 93 1 11 4 90 4 52 10 223 6 125 7 190 9 50 5 83 5 1 81 5 14 20 8 166 8 1...
output:
26215 59110 32896 50625 54741 54741 54741 48315 32896 1 32896 32896 54741 32896 59110 54741 54741 32896 32896 32896 32896 32896 59110 59110 32896 32896 54741 32896 21846 17476 1 54741 54741 32896 54741 32896 17476 32896 15420 54741 59110 21846 32896 48060 32896 54741 32896 1 32896 54741 32896 0 5911...
result:
ok 100 numbers
Test #31:
score: 0
Accepted
time: 807ms
memory: 3660kb
input:
100 9 215 61 138 100 40 83 175 61 173 96 207 42 145 62 182 52 166 58 3 144 48 236 67 117 89 22 127 59 91 7 104 77 224 75 115 37 134 14 247 18 135 97 83 40 56 51 112 72 236 84 211 12 36 54 239 68 109 15 105 1 130 92 81 53 165 77 5 90 123 5 3 120 73 64 42 11 89 25 58 16 233 68 144 5 76 46 13 44 180 72...
output:
32896 32896 59110 17476 15420 32896 32896 32896 59110 54741 32896 32896 32896 54741 54741 15420 32896 32896 59110 32896 54741 32896 32896 32896 59110 59110 59110 59110 32896 32896 26215 59110 54741 32896 15420 54741 54741 43690 54741 39321 17476 59110 54741 32896 32896 32896 59110 54741 32896 32896 ...
result:
ok 100 numbers
Test #32:
score: 0
Accepted
time: 57ms
memory: 3624kb
input:
100 10 3 1 41 1 226 1 128 1 64 1 131 1 155 1 245 1 9 1 53 1 23 3 1 53 1 210 1 194 1 74 1 43 1 223 1 246 1 2 1 252 1 150 1 134 1 232 1 195 1 227 1 167 1 95 1 209 1 6 1 23 1 66 1 50 1 42 1 6 123 1 181 1 133 1 78 1 205 1 236 1 14 129 1 237 1 122 1 108 1 12 1 57 1 0 1 9 1 17 1 56 1 239 1 76 1 167 1 243 ...
output:
26470 32896 25246 32896 54231 252 32896 54741 32896 32896 32896 1 54741 32896 32896 59110 32896 54741 39321 17476 32896 43690 59110 26470 5881 59110 32896 32896 32896 54741 24141 82 54741 1 22101 54741 32896 32896 32896 32896 54741 3076 54741 32896 32896 54741 30856 54741 32896 54741 32896 54741 393...
result:
ok 100 numbers
Test #33:
score: -100
Time Limit Exceeded
input:
100 46 237 36 79 25 107 43 184 47 193 8 215 22 202 1 180 4 228 1 147 2 137 20 88 46 12 27 26 35 22 22 245 2 27 5 63 30 80 8 123 27 236 5 102 48 96 8 126 7 129 41 9 14 7 16 142 28 90 21 196 36 98 21 13 42 185 25 8 33 161 16 58 20 158 5 53 23 108 12 150 12 39 34 167 40 99 30 48 6 189 43 235 27 26 229 ...