QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#707225 | #9562. 欧伊昔 | Doqe | 100 ✓ | 253ms | 86352kb | C++14 | 6.2kb | 2024-11-03 15:11:37 | 2024-11-03 15:11:38 |
Judging History
answer
#include <bits/stdc++.h>
#define assert(x)
using namespace std;
//typedef long double db;
typedef double db;
// CP
// Function to compute the outer product of three vectors
vector<vector<vector<db>>> outer(const vector<db>& a, const vector<db>& b, const vector<db>& c) {
int I = a.size();
int J = b.size();
int K = c.size();
vector<vector<vector<db>>> result(I, vector<vector<db>>(J, vector<db>(K, 0)));
for (int i = 0; i < I; ++i)
for (int j = 0; j < J; ++j)
for (int k = 0; k < K; ++k)
result[i][j][k] = a[i] * b[j] * c[k];
return result;
}
// Function to reconstruct the tensor from factor matrices
vector<vector<vector<db>>> reconstruct(const vector<vector<db>>& A, const vector<vector<db>>& B, const vector<vector<db>>& C, int I, int J, int K, int R) {
vector<vector<vector<db>>> tensor_reconstructed(I, vector<vector<db>>(J, vector<db>(K, 0)));
for (int r = 0; r < R; ++r) {
auto outer_product = outer(A[r], B[r], C[r]);
for (int i = 0; i < I; ++i)
for (int j = 0; j < J; ++j)
for (int k = 0; k < K; ++k)
tensor_reconstructed[i][j][k] += outer_product[i][j][k];
}
return tensor_reconstructed;
}
// Function to compute the Frobenius norm
db frobeniusNorm(const vector<vector<vector<db>>>& tensor1, const vector<vector<vector<db>>>& tensor2, int I, int J, int K) {
db norm = 0.0;
for (int i = 0; i < I; ++i)
for (int j = 0; j < J; ++j)
for (int k = 0; k < K; ++k)
norm += (tensor1[i][j][k] - tensor2[i][j][k]) * (tensor1[i][j][k] - tensor2[i][j][k]);
assert(norm>=0);
return sqrt(norm);
}
// Gradient descent for CP decomposition
db mn=1e100;
vector<vector<db>>mA,mB,mC;
mt19937 rnd(342356);
bool CPDecomposition(const vector<vector<vector<db>>>& tensor, int I, int J, int K, int R, vector<vector<db>>& A, vector<vector<db>>& B, vector<vector<db>>& C, db learning_rate = 0.01, int max_iter = 30000) {
int w=0;
// Initialize factor matrices randomly
A.resize(R, vector<db>(I));
B.resize(R, vector<db>(J));
C.resize(R, vector<db>(K));
for (int r = 0; r < R; ++r) {
for (int i = 0; i < I; ++i) A[r][i] = static_cast<db>(rnd()&524287) / 524288;
for (int j = 0; j < J; ++j) B[r][j] = static_cast<db>(rnd()&524287) / 524288;
for (int k = 0; k < K; ++k) C[r][k] = static_cast<db>(rnd()&524287) / 524288;
}
db zz=0;
for (int iter = 0; iter <= max_iter; ++iter) {
// Reconstruct the tensor
auto tensor_reconstructed = reconstruct(A, B, C, I, J, K, R);
// Calculate the error tensor
db error = frobeniusNorm(tensor, tensor_reconstructed, I, J, K);
learning_rate=0.1*exp(-sqrtl(iter/max_iter));
// Update A, B, C using gradients
for (int r = 0; r < R; ++r) {
for (int i = 0; i < I; ++i)
for (int j = 0; j < J; ++j)
for (int k = 0; k < K; ++k) {
db gradient = (tensor_reconstructed[i][j][k] - tensor[i][j][k]) * B[r][j] * C[r][k];
assert(gradient>=0 || gradient <= 0);
A[r][i] -= learning_rate * gradient;
if (fabs(A[r][i]) > 1e2) // Too large
return false;
}
for (int j = 0; j < J; ++j)
for (int i = 0; i < I; ++i)
for (int k = 0; k < K; ++k) {
db gradient = (tensor_reconstructed[i][j][k] - tensor[i][j][k]) * A[r][i] * C[r][k];
assert(gradient>=0 || gradient <= 0);
B[r][j] -= learning_rate * gradient;
if (fabs(B[r][j]) > 1e2) // Too large
return false;
}
for (int k = 0; k < K; ++k)
for (int i = 0; i < I; ++i)
for (int j = 0; j < J; ++j) {
db gradient = (tensor_reconstructed[i][j][k] - tensor[i][j][k]) * A[r][i] * B[r][j];
assert(gradient>=0 || gradient <= 0);
C[r][k] -= learning_rate * gradient;
if (fabs(C[r][k]) > 1e2) // Too large
return false;
}
}
if(fabs(zz - error) / error < 1e-6)
if(error > 1e-11)return false;
zz = error;
if (iter == 7000 && error > 1e-6) return false;
if (iter % 5000 == 0 )
cerr << "Iteration " << iter << ", Loss: " << error << endl;
}
return true;
}
const int V = 3;
const int I = V, J = V, K = V, R = 4;
int OP[V][V];
db A[R][V],B[R][V],C[R][V];
const int N=6e5+10,M=1e8+10;
db a[N],b[N],c[N];
db tmp[M],*O=tmp;
inline db*create(int len){db*x=O;O+=len;assert(O-tmp<M);return x;}
//The major function
void trans(db*a,db*b,db*c,int n)
{
fill(c,c+n,0);
if(n==1)
{
*c=*a* *b;
return;
}
if(n==V)
{
for(int i=0;i<V;++i)for(int j=0;j<V;++j)
if(OP[i][j]>=0)c[OP[i][j]]+=a[i]*b[j];
return;
}
int m=n/V;
db *_a=create(m),*_b=create(m),*_c=create(m);
for(int _=0;_<R;++_)
{
for(int i=0;i<m;++i){_a[i]=0;for(int j=0;j<V;++j)_a[i]+=A[_][j]*a[i*V+j];}
for(int i=0;i<m;++i){_b[i]=0;for(int j=0;j<V;++j)_b[i]+=B[_][j]*b[i*V+j];}
trans(_a,_b,_c,m);for(int i=0;i<m;++i)for(int j=0;j<V;++j)c[i*V+j]+=C[_][j]*_c[i];
}
}
int main()
{
cin.tie(0)->sync_with_stdio(0);
for(int i=0;i<V;++i)
for(int j=0;j<V;++j)
cin>>OP[i][j];
vector<vector<vector<db>>> tensor(I, vector<vector<db>>(J, vector<db>(K)));
for(int i=0;i<I;++i)
for(int j=0;j<J;++j)
for(int k=0;k<K;++k)
tensor[i][j][k]=OP[i][j]==k;
vector<vector<db>>A,B,C;
while(!CPDecomposition(tensor, I, J, K, R, A, B, C));
for(int i=0;i<R;++i)for(int j=0;j<V;++j)
::A[i][j]=A[i][j],::B[i][j]=B[i][j],::C[i][j]=C[i][j];
int base;cin>>base;
int U=pow(V,base);
for(int i=0;i<U;++i)cin>>a[i];
for(int i=0;i<U;++i)cin>>b[i];
trans(a,b,c,U);
for(int i=0;i<U;++i)cout<<(long long)(c[i]+0.5)<<" ";cerr<<endl;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 66ms
memory: 10260kb
input:
0 1 2 1 2 0 2 0 1 1 7 1 5 8 4 5
output:
81 61 79
result:
ok single line: '81 61 79 '
Test #2:
score: 5
Accepted
time: 69ms
memory: 10260kb
input:
0 1 2 1 2 0 2 0 1 3 6 4 1 8 7 9 6 1 4 1 6 4 5 8 2 5 2 8 1 8 7 9 8 1 1 8 8 9 6 5 9 8 7 5 0 4 7 7 1 1 8 0 9 2 2 8 9 3 8 8 5 2 1 5
output:
697 607 678 641 734 754 699 750 774 704 695 713 676 751 706 737 724 668 686 706 636 703 751 761 713 764 754
result:
ok single line: '697 607 678 641 734 754 699 75...06 636 703 751 761 713 764 754 '
Test #3:
score: 5
Accepted
time: 71ms
memory: 10296kb
input:
0 1 2 1 2 0 2 0 1 6 4 7 8 2 3 9 8 2 3 1 3 2 7 4 9 1 9 9 3 9 4 8 8 3 4 2 6 7 0 4 5 0 3 7 8 0 0 0 9 5 4 3 0 9 7 6 0 5 9 6 1 6 9 4 1 9 5 4 5 8 8 3 2 4 1 2 0 2 0 2 7 9 6 8 1 0 9 4 1 5 5 4 2 7 5 8 4 2 8 2 4 2 0 7 3 3 5 2 6 2 5 4 3 2 3 7 3 4 3 7 8 4 3 5 5 1 2 9 9 4 2 4 0 3 2 4 0 6 5 8 6 3 4 7 8 7 2 9 2 0 ...
output:
14700 14442 14900 14208 14286 14793 14470 14589 14638 14410 14487 14557 14384 14379 14349 14487 14611 14746 14691 14522 14296 14618 14777 14822 14692 14403 14429 14634 14616 14623 14881 14495 14435 14921 14915 14387 14662 14498 14959 14809 14728 14395 14052 14358 13982 14996 14685 14955 14393 14327 ...
result:
ok single line: '14700 14442 14900 14208 14286 ... 14314 14301 14704 14346 14600 '
Test #4:
score: 5
Accepted
time: 79ms
memory: 15180kb
input:
0 1 2 1 2 0 2 0 1 9 2 3 5 0 2 1 7 9 9 8 3 3 8 6 0 7 1 9 5 0 9 7 2 4 8 5 3 7 2 1 5 3 6 1 6 3 3 4 0 6 3 1 4 4 3 2 8 0 5 1 3 0 2 9 6 7 7 0 8 2 7 4 4 7 2 7 8 6 0 7 4 6 7 5 2 6 7 9 6 1 5 8 5 6 7 9 7 9 3 7 6 4 0 6 7 5 6 5 2 2 2 8 7 7 4 8 9 0 4 3 1 4 2 7 9 8 7 4 1 4 0 6 2 5 6 9 1 2 4 2 6 9 8 6 6 6 3 1 7 1 ...
output:
394989 396540 394557 395621 396482 394434 394798 394810 395056 395834 393311 394708 394814 393791 397819 393252 393212 394704 396791 395950 397023 395361 395243 394075 393972 394019 396705 396235 396328 395603 395505 395548 395307 394855 395834 395596 395881 395357 396429 395491 394378 395132 396642...
result:
ok single line: '394989 396540 394557 395621 39...57 392714 395489 394271 395605 '
Test #5:
score: 5
Accepted
time: 215ms
memory: 85344kb
input:
0 1 2 1 2 0 2 0 1 11 1 6 2 1 2 0 1 5 0 2 0 0 1 5 0 3 7 1 7 5 6 5 0 2 4 3 6 6 6 6 3 9 2 1 1 1 8 7 8 5 2 1 4 9 7 6 1 3 6 3 8 2 9 4 3 0 6 3 4 8 6 7 1 1 2 8 7 7 1 8 5 6 0 2 1 0 5 9 7 0 2 0 3 6 9 6 3 7 6 6 5 1 1 8 2 6 5 1 6 4 3 3 2 6 4 9 1 6 1 7 7 8 8 7 2 4 9 3 8 9 0 6 1 7 8 2 8 4 8 4 9 6 4 1 3 8 8 3 9 7...
output:
3604328 3606586 3614489 3601944 3600772 3606127 3610365 3607012 3609133 3605717 3603103 3605403 3601041 3612587 3612125 3599467 3610664 3605910 3610160 3605199 3601396 3606846 3609903 3609073 3607772 3607588 3606298 3603367 3608036 3608244 3607173 3608461 3600398 3603955 3606346 3605362 3608084 3609...
result:
ok single line: '3604328 3606586 3614489 360194...608101 3606150 3600205 3608243 '
Subtask #2:
score: 5
Accepted
Test #6:
score: 5
Accepted
time: 70ms
memory: 10244kb
input:
1 2 1 2 0 0 1 0 0 1 8 9 3 1 6 1
output:
84 19 57
result:
ok single line: '84 19 57 '
Test #7:
score: 5
Accepted
time: 69ms
memory: 10228kb
input:
1 2 1 2 0 0 1 0 0 3 0 9 8 8 9 2 6 5 1 7 2 9 8 8 7 9 1 9 8 0 3 6 8 6 6 1 6 2 7 1 0 3 4 9 1 7 3 1 3 3 6 1 4 6 7 3 9 5 0 6 5 6 6 8
output:
2070 1350 930 936 1077 524 774 445 422 995 939 563 984 446 409 681 160 255 715 715 415 569 372 227 360 144 155
result:
ok single line: '2070 1350 930 936 1077 524 774...15 415 569 372 227 360 144 155 '
Test #8:
score: 5
Accepted
time: 67ms
memory: 10312kb
input:
1 2 1 2 0 0 1 0 0 6 4 6 7 3 1 5 3 4 8 5 8 4 8 2 5 9 5 8 9 9 5 0 1 3 3 6 2 6 2 0 7 4 1 9 3 0 1 4 7 6 3 5 6 6 6 8 5 4 7 6 5 6 0 9 3 3 7 7 5 3 2 8 8 6 6 7 5 1 5 0 4 0 6 4 4 0 8 8 9 7 2 3 9 1 2 7 7 5 9 4 2 0 4 0 7 3 2 0 0 5 7 3 0 3 1 4 7 1 5 0 5 7 0 7 3 3 3 0 4 4 8 3 0 3 5 4 6 4 6 2 5 2 6 0 1 0 3 2 7 2 ...
output:
83790 80087 47498 54766 53378 30734 37004 38711 20149 56840 51419 30908 44535 34931 19224 28930 21902 13476 40400 35311 23275 29138 24090 14354 18657 16767 10404 54800 54365 26409 41788 36518 23297 26116 26545 15046 43022 40283 20072 32970 27617 15595 19273 21888 11540 29066 27596 14097 20358 17763 ...
result:
ok single line: '83790 80087 47498 54766 53378 ... 3398 2919 2036 2020 2095 1314 '
Test #9:
score: 5
Accepted
time: 82ms
memory: 16024kb
input:
1 2 1 2 0 0 1 0 0 9 1 4 5 7 9 9 3 2 8 2 1 9 6 3 7 1 5 1 8 5 5 2 2 6 4 0 2 2 4 5 5 6 1 0 4 3 4 6 8 5 9 6 5 0 6 3 9 9 6 0 3 0 9 8 4 8 5 2 6 2 3 7 6 1 6 0 0 0 6 9 1 5 1 1 6 9 3 0 1 6 3 9 9 4 1 6 7 6 1 9 4 8 3 7 5 6 7 7 4 2 1 8 0 2 0 1 4 9 6 1 3 9 3 9 1 7 6 3 5 1 2 9 5 9 1 9 0 2 6 8 0 3 2 3 3 8 7 5 7 5 ...
output:
5491236 3870726 2722667 4095376 3095055 2071305 2714963 2074656 1399744 4044155 3120903 2064947 3040305 2366779 1542749 2083106 1574507 1033341 2685025 2000208 1380383 2078336 1610975 1031792 1345673 1054928 715576 4117744 2722921 1889883 3038009 1917155 1380031 2125417 1319541 942766 2939040 204967...
result:
ok single line: '5491236 3870726 2722667 409537...8 22661 14107 20702 15112 9567 '
Test #10:
score: 5
Accepted
time: 218ms
memory: 85788kb
input:
1 2 1 2 0 0 1 0 0 11 7 0 4 5 4 2 8 0 5 2 6 3 3 3 7 4 9 1 2 5 3 2 2 4 9 2 3 4 2 6 6 4 7 8 5 4 0 2 1 1 2 2 6 3 6 5 6 8 3 9 3 4 5 0 6 7 1 9 3 7 9 2 6 8 8 2 4 6 4 1 8 9 2 7 7 8 4 3 8 8 9 3 8 8 8 0 2 0 1 8 8 4 5 6 8 8 8 3 4 0 2 7 6 5 0 8 8 0 5 1 9 7 2 4 4 9 5 8 8 7 3 7 3 4 0 1 8 6 5 5 9 0 0 6 3 7 1 3 5 3...
output:
86479708 63720192 41859212 65499632 45056892 30743097 43125563 31086911 20505561 62406595 47201203 31455187 48665387 34840892 23780593 31386819 23538226 15647083 41894617 31577694 20829302 32537059 22546949 15608457 21012850 15484091 10337868 62979540 46676543 31353425 48890707 34173423 23561609 319...
result:
ok single line: '86479708 63720192 41859212 654... 93847 60903 84153 63837 41857 '
Subtask #3:
score: 20
Accepted
Test #11:
score: 20
Accepted
time: 67ms
memory: 10288kb
input:
1 1 1 0 0 0 1 1 1 1 6 2 1 3 1 5
output:
18 63 0
result:
ok single line: '18 63 0 '
Test #12:
score: 20
Accepted
time: 85ms
memory: 10296kb
input:
1 1 0 0 0 1 0 0 1 3 4 6 4 5 6 8 7 7 4 0 0 9 1 0 9 0 8 5 3 4 0 0 4 2 3 5 1 4 2 5 5 6 2 4 6 5 2 5 0 0 4 0 6 3 8 1 2 3 7 0 6 8 4 8
output:
1776 1049 0 1615 1167 0 0 0 0 1582 1203 0 1536 1202 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok single line: '1776 1049 0 1615 1167 0 0 0 0 ...1202 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #13:
score: 20
Accepted
time: 83ms
memory: 10348kb
input:
1 1 1 1 1 1 0 0 0 6 8 7 3 9 0 9 3 3 8 3 2 4 9 8 4 1 2 9 0 3 1 8 7 9 9 4 0 4 6 6 7 2 2 1 4 4 4 3 6 7 8 0 2 7 4 9 8 6 2 9 9 8 3 7 6 4 1 2 2 0 3 0 3 9 8 5 9 3 5 6 4 1 9 6 3 2 9 4 9 2 7 5 0 3 0 2 7 5 4 5 6 1 9 3 7 2 6 3 2 3 5 3 3 0 8 1 4 0 1 1 4 5 0 0 2 1 8 3 6 6 3 0 1 9 3 4 9 2 7 1 2 8 5 1 4 3 4 9 8 5 ...
output:
12752 31880 0 31880 41444 0 0 0 0 38256 76512 0 54196 117956 0 0 0 0 0 0 0 0 0 0 0 0 0 38256 76512 0 66948 143460 0 0 0 0 51008 98828 0 191280 210408 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38256 70136 0 63760 102016 0 0 0 0 79700 111580 0 105204 219972 0 0 0 ...
result:
ok single line: '12752 31880 0 31880 41444 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #14:
score: 20
Accepted
time: 77ms
memory: 15172kb
input:
0 0 1 0 0 1 0 0 1 9 3 5 7 4 5 0 9 0 8 1 6 7 7 2 6 3 2 9 8 2 8 1 5 2 0 0 1 0 6 5 8 6 9 3 2 1 8 3 0 9 2 9 0 2 6 0 0 4 0 6 2 7 8 7 9 8 8 8 4 5 1 1 8 3 1 1 6 2 6 9 4 9 2 9 4 7 3 7 0 8 3 3 1 5 8 8 6 3 5 3 9 6 1 8 1 7 4 6 4 7 1 8 4 1 3 3 3 3 0 7 5 5 2 4 0 0 9 7 2 6 0 9 0 9 6 3 0 5 0 8 3 4 3 0 3 4 8 5 9 6 ...
output:
203913878 109813438 0 98983010 49535892 0 0 0 0 102800292 53353174 0 55217428 20418020 0 0 0 0 0 0 0 0 0 0 0 0 0 107949184 50068536 0 53708270 24324076 0 0 0 0 56549038 23791432 0 27963810 13316100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99071784 48115508 0 49...
result:
ok single line: '203913878 109813438 0 98983010... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #15:
score: 20
Accepted
time: 231ms
memory: 85836kb
input:
0 0 0 0 0 0 0 0 0 11 4 2 4 1 1 1 9 6 0 9 2 5 4 0 4 7 7 3 5 4 2 4 3 7 1 2 4 6 7 0 1 1 4 4 1 2 9 3 9 5 0 1 9 8 7 8 9 0 9 8 4 2 8 8 4 2 2 0 8 7 7 9 7 8 6 8 7 7 8 1 6 2 4 3 9 3 9 9 2 7 0 7 2 3 7 5 9 5 2 1 6 3 3 0 8 4 2 8 3 7 2 5 4 9 8 4 5 1 3 7 5 1 4 3 8 8 4 3 3 6 9 5 4 8 5 1 7 1 9 0 5 7 8 0 6 5 5 2 7 9...
output:
635411468335 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok single line: '635411468335 0 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Subtask #4:
score: 30
Accepted
Test #16:
score: 30
Accepted
time: 70ms
memory: 10240kb
input:
1 1 1 0 0 1 1 1 0 1 1 0 9 8 1 9
output:
81 99 0
result:
ok single line: '81 99 0 '
Test #17:
score: 30
Accepted
time: 86ms
memory: 10292kb
input:
0 0 1 0 0 1 1 1 0 3 7 6 2 7 7 9 5 5 6 0 5 7 5 8 1 0 6 0 9 3 3 5 1 8 2 2 1 8 5 9 1 0 0 0 4 9 1 4 3 2 5 1 9 2 2 8 7 6 8 7 3 9 1 0
output:
2402 1847 0 1687 1320 0 0 0 0 2363 1614 0 1492 955 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok single line: '2402 1847 0 1687 1320 0 0 0 0 ... 955 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #18:
score: 30
Accepted
time: 72ms
memory: 10312kb
input:
1 0 0 0 1 0 1 0 1 6 4 6 4 1 9 6 7 6 7 5 0 7 4 1 5 7 5 7 4 7 9 7 6 3 3 8 5 4 4 0 8 8 9 2 8 3 5 9 3 1 4 1 1 5 7 7 7 5 7 4 9 8 1 0 7 9 3 8 4 8 2 9 5 3 4 0 5 3 8 2 7 8 8 7 4 8 5 2 4 2 1 0 6 1 7 0 1 2 9 8 3 5 9 9 0 1 6 3 9 7 0 1 9 8 4 4 4 3 1 4 5 4 4 6 2 2 7 2 6 5 8 5 4 5 9 7 4 1 7 1 3 2 6 3 6 0 0 5 9 6 ...
output:
322011 265965 0 260223 215956 0 0 0 0 263733 211227 0 215511 174371 0 0 0 0 0 0 0 0 0 0 0 0 0 266760 215095 0 211273 172309 0 0 0 0 214580 167887 0 173403 135852 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 253574 204516 0 204277 166421 0 0 0 0 207948 162851 0 1729...
result:
ok single line: '322011 265965 0 260223 215956 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #19:
score: 30
Accepted
time: 77ms
memory: 14968kb
input:
0 0 0 1 0 1 1 0 1 9 4 2 6 7 4 0 9 7 7 1 6 0 1 4 4 6 7 0 8 4 1 3 2 2 0 6 6 8 9 7 0 3 8 9 4 1 8 6 5 7 5 4 2 8 3 7 9 6 1 7 5 2 9 2 7 9 7 1 2 1 3 4 4 7 0 7 3 9 7 6 5 3 8 7 0 4 6 2 7 4 0 6 0 4 4 1 2 0 7 4 2 2 4 6 8 0 3 2 2 1 8 7 7 7 8 3 2 4 6 4 4 8 2 4 6 5 0 0 1 7 5 0 6 7 3 4 4 3 5 6 8 1 9 2 5 1 6 0 6 5 ...
output:
40385937 31934762 0 31782968 25077003 0 0 0 0 31023309 24888805 0 23789431 19681164 0 0 0 0 0 0 0 0 0 0 0 0 0 31987079 25546274 0 25044943 19461021 0 0 0 0 25039688 19751368 0 19460419 15885046 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30628498 25280629 0 245971...
result:
ok single line: '40385937 31934762 0 31782968 2... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Test #20:
score: 30
Accepted
time: 227ms
memory: 86352kb
input:
1 0 1 0 1 1 0 1 1 11 1 2 3 9 6 4 9 3 8 9 5 9 4 3 3 2 9 6 1 8 0 4 2 5 2 0 7 6 8 0 1 7 9 7 2 8 7 2 4 5 3 1 6 7 8 9 5 2 2 2 7 5 2 6 9 1 5 1 9 4 9 6 0 3 6 2 1 1 0 7 7 8 0 8 7 6 7 9 3 7 8 7 3 3 0 5 9 1 7 3 5 4 3 3 1 1 6 4 2 7 4 1 4 3 4 7 0 7 2 5 6 9 5 9 1 6 4 9 6 9 7 9 2 2 5 3 7 3 7 5 9 8 9 7 1 7 7 6 0 2...
output:
3330757 6904276 0 6996758 14294336 0 0 0 0 7094512 14150626 0 14703887 29236909 0 0 0 0 0 0 0 0 0 0 0 0 0 6778135 14131886 0 14023801 28519549 0 0 0 0 14162278 28291932 0 28809996 57166032 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7085904 14086903 0 14087635 278...
result:
ok single line: '3330757 6904276 0 6996758 1429... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '
Subtask #5:
score: 10
Accepted
Test #21:
score: 10
Accepted
time: 82ms
memory: 15068kb
input:
0 2 2 1 1 1 0 1 1 9 2 7 2 7 4 5 9 7 9 6 8 4 0 6 3 3 6 3 0 5 2 3 7 6 7 8 3 6 1 1 6 9 9 2 7 2 1 2 8 2 9 3 5 0 5 7 1 2 3 1 4 8 0 4 3 4 2 8 8 4 2 9 3 7 1 1 6 6 4 0 9 6 5 8 8 1 3 8 7 3 0 4 3 8 7 0 0 7 6 4 3 6 0 2 3 3 6 5 0 5 9 8 6 1 0 4 7 8 2 4 7 4 8 6 9 6 3 5 1 8 0 1 4 7 0 0 1 2 7 7 0 5 5 3 8 2 7 8 9 8 ...
output:
18440 36200 13740 21447 61214 26652 5665 22043 8496 29112 57852 21456 67960 192140 70368 29748 86008 35360 8912 17724 6564 29955 76168 32916 11361 32499 12720 18364 76188 36444 42131 187672 92455 14190 70759 31583 70268 162402 69612 200033 446344 181086 87111 192351 80214 28253 57785 24432 98560 188...
result:
ok single line: '18440 36200 13740 21447 61214 ...76 81555 44223 4512 28578 4596 '
Test #22:
score: 10
Accepted
time: 86ms
memory: 10256kb
input:
0 1 2 1 0 0 1 0 1 1 0 9 2 9 7 1
output:
86 101 0
result:
ok single line: '86 101 0 '
Test #23:
score: 10
Accepted
time: 71ms
memory: 10264kb
input:
2 2 0 0 0 1 0 0 1 5 7 8 3 5 6 1 5 0 1 9 7 3 0 7 0 9 4 7 2 3 1 4 9 4 6 4 9 6 9 8 9 7 8 4 1 4 1 7 7 3 9 3 6 6 8 2 4 3 4 2 4 7 9 9 7 3 0 7 2 6 8 2 3 7 3 2 5 8 9 6 8 4 2 1 1 6 8 6 2 9 8 3 8 5 2 1 8 3 1 3 9 8 7 6 2 9 3 2 1 7 4 8 3 3 8 0 4 5 1 5 2 2 7 3 1 9 4 4 7 1 7 6 5 0 6 8 9 3 3 8 8 6 5 7 6 3 6 0 0 6 ...
output:
65779 30392 21974 25288 12458 7720 24011 9803 10740 28954 12095 10240 11185 4960 3594 10287 3557 5314 24799 11548 8039 9011 4444 2949 10517 4941 3339 27387 10507 10096 12176 3831 4214 8780 3028 4385 14146 4070 5339 5293 2110 1761 4031 1015 2464 10147 3888 3541 4242 1177 1726 3898 1645 1300 24473 122...
result:
ok single line: '65779 30392 21974 25288 12458 ... 1803 912 352 590 2096 891 973 '
Test #24:
score: 10
Accepted
time: 89ms
memory: 12748kb
input:
2 1 1 0 2 2 2 1 1 8 1 1 0 0 2 9 1 0 3 7 7 3 9 2 5 0 1 4 3 3 4 3 0 1 4 5 3 4 2 7 6 3 7 6 5 1 5 6 4 0 8 3 1 3 6 2 0 2 4 7 8 6 3 1 7 0 1 3 1 2 8 9 3 3 0 4 6 0 5 6 1 0 8 9 9 4 4 8 0 7 0 8 3 1 1 1 3 0 8 4 3 8 7 2 8 5 6 4 3 7 7 9 5 8 5 2 6 0 7 5 2 1 9 7 4 8 2 0 4 2 1 0 4 0 0 6 7 1 6 4 9 2 9 1 7 1 3 0 4 3 ...
output:
20 128 104 64 304 280 72 432 351 81 437 378 242 1505 1243 297 1622 1373 81 488 403 264 1377 1218 287 1645 1350 48 276 256 432 1170 1476 288 1158 1260 396 675 1036 1344 5740 5564 1460 3940 4930 276 921 1084 1524 5298 5754 1336 4529 4886 64 376 328 336 1221 1278 304 1421 1356 360 1096 1316 1276 5976 5...
result:
ok single line: '20 128 104 64 304 280 72 432 3...1334228 322796 1305543 1304871 '
Test #25:
score: 10
Accepted
time: 88ms
memory: 16368kb
input:
2 1 0 2 2 1 0 1 0 9 3 3 3 3 9 1 1 8 2 3 3 3 1 2 7 1 3 9 9 0 8 5 3 3 3 8 9 5 3 5 9 2 2 2 2 0 2 1 9 2 2 0 6 8 6 3 2 0 6 0 0 1 8 1 5 4 7 2 7 5 5 3 1 8 2 7 4 2 4 9 3 8 5 2 5 8 5 5 5 1 3 5 7 4 2 1 9 7 5 5 5 9 4 2 8 1 7 3 1 2 6 3 6 6 1 3 8 6 8 8 8 2 3 8 0 5 3 5 1 6 3 7 9 7 4 6 3 4 8 5 4 9 4 2 7 4 4 6 4 4 ...
output:
382719 394780 410001 404799 370344 395193 369887 382774 367853 418595 409880 413992 401861 383871 399489 394754 416730 392562 379397 399755 381864 400221 387273 387760 341016 403931 377194 397060 406517 414908 381951 399267 395721 390054 411603 415746 422094 409681 417867 384646 400520 405957 415701...
result:
ok single line: '382719 394780 410001 404799 37...19 409550 390200 424778 402937 '
Subtask #6:
score: 10
Accepted
Dependency #5:
100%
Accepted
Test #26:
score: 10
Accepted
time: 104ms
memory: 30768kb
input:
0 0 1 2 0 0 2 2 2 10 4 9 8 4 7 8 0 9 7 4 8 2 1 5 5 2 0 6 4 7 5 8 5 2 4 1 9 8 2 6 4 0 1 1 3 2 4 3 6 3 1 5 2 9 6 5 3 7 0 3 6 7 8 2 6 7 6 2 5 1 9 6 3 9 7 1 5 8 3 7 9 2 8 9 6 9 8 8 2 2 0 9 7 9 9 5 4 1 3 0 7 9 9 7 8 9 8 1 9 5 0 0 6 2 3 7 1 9 8 5 8 3 9 0 1 5 3 5 9 8 7 9 1 6 6 1 8 3 2 2 4 9 0 7 9 3 0 4 0 5...
output:
20727578 5156335 21621423 5121038 1270467 5610621 21819960 5435312 21368600 5066732 1286635 5335177 1284793 330067 1393001 5138370 1263197 5166174 21409615 5333424 21616454 5226007 1273977 5391904 21636789 5495408 21723289 5235685 1355263 5405449 1324225 330456 1407383 5392455 1306198 5244026 134256...
result:
ok single line: '20727578 5156335 21621423 5121...4322 22029026 6092995 20320082 '
Test #27:
score: 10
Accepted
time: 192ms
memory: 30508kb
input:
2 1 2 0 2 1 0 1 1 10 0 4 5 9 6 3 7 7 7 4 6 3 1 4 6 0 0 7 7 2 2 1 9 9 0 5 0 7 3 1 2 6 2 4 0 7 1 7 3 5 2 3 2 8 2 0 9 1 7 4 6 3 5 5 2 6 2 3 0 8 4 3 7 1 3 6 6 8 5 9 0 4 9 3 2 3 6 2 8 1 6 3 7 7 7 1 3 5 2 4 6 5 3 9 9 8 6 5 0 9 6 5 1 5 1 2 2 5 1 3 3 0 7 3 8 2 7 8 8 6 4 9 9 0 6 7 5 3 9 3 5 4 4 3 1 2 2 2 9 5...
output:
43038 42855 39927 85518 135400 109061 65250 91041 77560 9437 97710 52589 28118 210304 118946 18999 157334 89213 26010 69990 46238 57184 173416 109828 40771 121147 79872 84789 68931 74358 61202 232223 146021 74817 154406 112183 79047 101039 88457 225186 271836 247023 155375 191141 172372 81601 83557 ...
result:
ok single line: '43038 42855 39927 85518 135400...1531294 778480 1570364 1176086 '
Test #28:
score: 10
Accepted
time: 109ms
memory: 31000kb
input:
0 2 1 0 2 0 0 1 0 10 6 1 3 6 1 3 2 6 3 5 4 6 7 8 2 2 9 9 6 4 7 4 1 4 4 5 5 5 7 8 5 3 0 5 8 3 5 9 6 8 7 2 7 6 1 8 1 8 5 5 1 6 4 3 3 2 9 9 6 4 4 0 2 0 7 9 2 0 7 7 8 4 3 1 4 9 5 7 4 2 9 5 7 4 8 8 0 3 7 0 9 0 2 6 1 9 4 8 1 5 6 7 0 3 5 0 9 5 0 6 1 5 4 4 9 9 6 4 1 9 3 0 0 2 8 0 5 7 0 0 8 1 8 9 3 9 4 8 1 0...
output:
197873744 77768748 78272872 81052318 31755812 32392416 81487741 33586834 33939514 78536360 31163941 30277517 31152191 12183902 12340469 30388455 12560737 12597240 76283839 32541707 32055742 30754734 11913534 11940382 29498605 11550990 11427215 81213484 32928302 32742694 31525193 12590193 12757953 30...
result:
ok single line: '197873744 77768748 78272872 81... 24378 15939 58367 32018 31619 '
Test #29:
score: 10
Accepted
time: 115ms
memory: 29700kb
input:
2 1 1 2 0 0 1 2 0 10 3 9 8 4 5 2 4 3 6 7 0 2 7 6 3 1 7 0 9 7 2 8 6 4 8 7 3 0 2 5 3 3 5 7 8 1 0 1 3 6 7 4 7 6 6 3 9 1 0 9 3 4 2 4 4 6 1 9 1 4 7 3 3 0 0 4 9 1 1 4 1 4 6 6 9 3 6 8 1 5 9 8 5 8 7 5 3 3 8 2 3 4 8 7 1 7 1 6 2 7 5 2 6 1 6 9 3 4 9 5 9 3 3 8 8 4 8 5 7 5 4 4 9 6 0 4 2 3 3 3 2 1 9 4 7 5 4 8 3 8...
output:
1179748 1192921 1215002 1211905 1168412 1204043 1197924 1166839 1178519 1292728 1173100 1223218 1230837 1220928 1220698 1222146 1165807 1194625 1311732 1218871 1216575 1256915 1207374 1211928 1206060 1161905 1187727 1156553 1167595 1179065 1166891 1214210 1199928 1157238 1180981 1170865 1179448 1193...
result:
ok single line: '1179748 1192921 1215002 121190...203760 1147499 1174644 1198543 '
Test #30:
score: 10
Accepted
time: 106ms
memory: 30064kb
input:
0 2 1 0 0 0 0 2 2 10 7 5 1 3 6 6 3 0 7 5 4 4 5 2 1 4 9 8 5 9 7 0 9 9 5 4 5 7 3 5 6 9 1 1 0 7 4 6 4 5 6 1 6 3 5 8 3 4 5 7 3 9 4 7 6 0 4 7 7 4 8 5 7 8 8 4 5 2 9 0 4 2 8 2 5 8 3 9 3 9 1 4 2 5 2 1 4 2 7 5 9 6 0 3 9 6 2 0 0 6 8 2 7 8 9 4 3 3 3 7 8 8 6 1 4 0 7 5 7 2 9 8 1 3 4 3 1 8 2 6 8 5 4 1 1 6 7 6 5 8...
output:
196463879 38204910 117127217 38517441 7241994 23190836 114538324 22353777 69603579 40069122 7748655 23110204 8270704 1483209 4319437 23892837 4686572 13708898 119648006 23077687 70562700 23558515 4464804 13461157 70628313 13871203 42508803 38940140 7929270 24205777 7647594 1481530 4599536 23764913 4...
result:
ok single line: '196463879 38204910 117127217 3... 355914 1881370 399066 1210127 '
Subtask #7:
score: 20
Accepted
Dependency #6:
100%
Accepted
Test #31:
score: 20
Accepted
time: 212ms
memory: 83988kb
input:
2 0 1 0 2 0 2 0 0 11 8 7 4 3 3 2 2 8 4 7 3 2 5 0 1 5 2 9 8 6 4 6 6 4 5 2 8 0 7 2 1 3 0 8 4 7 8 6 6 5 5 0 5 3 1 0 8 3 8 2 0 4 8 1 0 2 1 7 3 3 7 9 1 0 5 2 7 4 7 6 8 9 2 4 5 9 3 8 3 6 2 4 3 6 8 7 9 1 0 7 0 5 8 5 3 1 5 9 6 8 2 6 3 6 2 5 3 6 1 9 1 3 5 0 1 8 7 3 4 1 0 7 5 2 2 7 7 1 3 9 7 8 5 4 6 7 3 1 0 0...
output:
985177950 197617374 590134862 198859485 39857044 118341573 591604462 119095453 354362936 197704625 39189734 118342480 39860423 7939740 23797318 118965644 23756253 70912290 591036105 118483662 354251518 118859385 23668766 71147297 355216746 71729751 212686586 196972402 39401015 117591721 39873134 806...
result:
ok single line: '985177950 197617374 590134862 ...225979 6274983 1240166 3667256 '
Test #32:
score: 20
Accepted
time: 253ms
memory: 85164kb
input:
0 0 1 1 1 1 1 0 2 11 1 0 2 6 5 3 0 0 0 2 2 0 1 9 3 2 2 4 7 1 5 4 9 3 0 3 5 4 0 9 0 4 6 1 7 0 9 6 7 2 3 3 4 1 5 1 8 7 5 1 0 9 3 8 2 5 8 2 9 7 0 0 7 5 2 6 1 0 5 7 1 2 3 3 9 8 0 0 2 7 3 6 6 1 1 7 9 5 4 0 1 3 1 6 7 6 4 5 3 8 4 2 9 7 9 9 8 9 5 2 9 4 9 7 8 3 3 2 0 9 6 6 1 2 6 2 3 8 7 9 1 8 0 8 7 2 0 7 2 8...
output:
3581462 5754641 1220642 5965897 10041685 1963115 1135917 1958584 411826 5747573 9494203 1888247 9892895 16813091 3226382 1997008 3315163 608774 1129634 1904230 390109 1968200 3302182 628108 414989 648851 117823 5956138 9704332 2139194 9725123 15932059 3386644 1960155 3188808 668719 9822510 16463138 ...
result:
ok single line: '3581462 5754641 1220642 596589...45 233 24 328 583 120 47 42 16 '
Test #33:
score: 20
Accepted
time: 220ms
memory: 83452kb
input:
0 0 2 1 1 0 1 0 1 11 3 0 4 3 8 8 9 5 9 5 4 7 5 9 3 1 2 9 7 4 4 2 0 2 9 3 0 1 5 7 6 2 8 3 1 1 1 2 6 4 0 3 5 0 1 9 0 2 0 5 9 5 0 3 8 1 4 2 9 6 2 7 6 5 4 9 6 7 8 0 2 2 0 5 9 6 9 1 0 6 2 5 6 6 2 1 4 8 2 7 7 7 1 5 1 0 7 6 5 6 9 7 7 8 0 5 0 3 8 5 6 3 4 5 0 0 0 0 7 2 8 9 5 5 2 4 3 6 4 3 5 1 6 1 0 6 0 3 6 4...
output:
85153722 84906263 21268764 84738289 84535953 21327909 21389513 21432155 5274187 85333772 84942732 21532317 84798394 84574291 21434923 21507496 21395628 5359637 21248623 21294540 5284029 21087846 21050510 5298099 5315124 5402089 1311842 85090269 84853049 21310350 84768138 84523908 21352636 21355920 2...
result:
ok single line: '85153722 84906263 21268764 847...25 322 111 559 432 120 62 20 9 '
Test #34:
score: 20
Accepted
time: 207ms
memory: 85156kb
input:
1 0 1 0 2 0 2 0 0 11 7 6 0 4 2 6 8 2 4 1 9 9 6 7 4 5 6 4 8 8 8 0 2 1 8 0 4 8 8 9 3 1 4 3 8 7 7 9 2 0 1 3 4 3 2 2 9 5 2 9 2 2 1 5 1 3 8 6 8 8 9 3 2 2 1 1 4 5 0 3 4 2 2 3 8 7 7 4 4 6 3 1 3 7 9 2 0 1 0 9 4 3 8 7 0 0 0 4 0 7 8 6 7 4 7 1 2 8 6 0 8 7 4 3 1 4 8 7 7 4 9 4 3 3 4 9 0 1 9 9 0 4 9 2 9 9 6 4 4 0...
output:
994111466 397150060 397599730 396836552 159523255 158269457 397579621 158693338 158829722 394747585 157664465 157880576 159473069 63883624 63822506 157657860 62972197 63079288 398211448 159513031 159031926 158357118 63948868 63091967 159293923 63857547 63583806 396845126 158629651 158891111 15747150...
result:
ok single line: '994111466 397150060 397599730 ...41806 41362 106599 41875 42891 '
Test #35:
score: 20
Accepted
time: 220ms
memory: 83984kb
input:
1 1 0 0 2 0 1 0 2 11 9 7 5 1 2 0 0 8 5 1 3 1 6 8 8 3 1 8 6 9 8 3 6 9 1 3 4 7 5 1 3 9 2 0 6 4 7 5 5 2 1 4 9 6 6 2 2 4 5 3 7 2 5 8 7 3 2 5 9 0 2 4 1 5 2 1 5 7 3 3 4 7 8 5 1 4 1 7 2 7 4 9 3 8 9 4 3 1 9 5 0 5 6 5 0 0 2 0 9 5 1 6 0 5 9 4 6 9 0 6 3 5 8 9 1 3 6 9 5 2 1 5 7 6 0 4 2 2 3 1 1 7 7 8 0 1 6 4 7 7...
output:
85268640 63918871 42556376 63827905 47904210 31816388 42791575 32002571 21365757 63669396 47737423 31807895 47709463 35699272 23780566 31874581 23899012 15917129 42627511 31894776 21323161 31954267 23896276 15921394 21375095 15978385 10696325 64280297 48343772 32054408 47758339 36044432 23764071 322...
result:
ok single line: '85268640 63918871 42556376 638... 94046 61782 81501 60647 41740 '
Test #36:
score: 20
Accepted
time: 221ms
memory: 85020kb
input:
2 0 0 2 1 0 0 2 0 11 9 9 0 7 7 8 0 1 3 5 5 7 9 5 9 3 2 4 8 7 8 1 8 4 7 8 5 7 8 3 6 5 7 7 2 0 0 5 9 7 2 9 3 0 0 6 1 3 5 9 5 3 6 2 9 4 1 5 1 4 7 1 0 9 5 8 2 5 7 4 7 0 0 0 5 0 5 8 3 5 9 5 7 1 7 9 9 7 6 5 5 9 1 4 5 8 2 2 7 7 6 6 2 3 1 4 4 5 6 2 9 2 7 2 3 1 1 4 3 7 3 2 9 4 3 1 8 4 1 0 0 6 3 4 4 0 6 9 0 8...
output:
989976588 202030165 596006786 197428424 40416878 119345733 585490896 118543750 354502739 196780433 39594033 120158665 38829798 8060573 24028094 117036152 23973304 71677451 582892649 118672758 355921584 116965372 23947520 71404572 348199097 70533536 211654780 196165724 40828183 119897236 39523854 781...
result:
ok single line: '989976588 202030165 596006786 ...226449 5875919 1203631 3537994 '
Test #37:
score: 20
Accepted
time: 212ms
memory: 84952kb
input:
2 1 0 2 2 0 1 1 2 11 5 8 5 1 8 6 4 2 8 6 0 6 6 9 0 7 6 7 1 1 9 9 4 6 1 1 9 0 8 2 6 4 4 0 1 1 0 3 5 0 9 2 3 2 2 8 6 3 7 3 2 9 2 0 6 6 3 5 4 0 9 0 9 6 6 3 9 2 4 4 0 3 6 0 6 9 7 2 9 5 1 0 3 2 3 9 1 0 4 0 8 9 6 5 7 0 0 2 5 8 9 6 9 2 1 3 1 3 2 4 7 1 0 6 6 6 8 3 4 2 0 6 9 8 6 6 8 2 6 5 1 6 8 3 6 2 0 0 7 1...
output:
18430 99980 102150 78888 86729 91107 54735 146841 126685 49957 95587 127540 127922 102020 151351 141803 132531 193759 96685 140717 177378 159811 141641 222617 158386 202892 262654 37136 128856 146731 51364 145689 150347 79180 176539 229098 72978 161523 211309 99900 265976 332680 138276 330513 429219...
result:
ok single line: '18430 99980 102150 78888 86729...962 42342449 64259348 85277675 '
Test #38:
score: 20
Accepted
time: 207ms
memory: 84960kb
input:
1 0 0 1 1 0 1 2 0 11 8 8 9 8 6 1 5 5 7 8 9 1 4 7 0 9 4 9 8 9 7 1 0 6 9 3 6 2 4 5 8 3 8 2 8 8 4 1 3 8 4 7 5 9 6 2 2 5 5 1 0 9 6 0 6 9 0 5 9 2 6 4 4 5 4 9 1 9 1 3 7 8 9 7 3 4 8 5 2 3 3 7 8 2 7 0 0 1 8 9 6 7 2 6 2 0 4 7 0 9 9 7 5 1 8 3 4 3 8 7 1 7 5 5 0 1 6 5 9 1 4 1 1 5 5 0 0 9 9 7 3 3 6 0 5 5 6 0 4 3...
output:
88967752 81165422 19095379 80621523 79734208 20456955 21559011 20372886 5571171 85773918 79442023 20231508 77505127 82727897 18994498 20015587 20834377 5151906 23723385 19920323 5306251 20787731 20095814 4879786 5782676 4876846 1315009 84021739 85130820 22436849 87013448 81797004 20381571 22112213 1...
result:
ok single line: '88967752 81165422 19095379 806...637 133 188 295 117 171 202 35 '
Test #39:
score: 20
Accepted
time: 215ms
memory: 85248kb
input:
2 1 0 2 2 2 1 2 2 11 3 1 4 2 0 7 5 2 2 0 8 1 0 7 7 3 9 3 4 5 3 6 9 2 0 7 5 6 5 2 0 2 1 5 0 8 8 8 6 6 0 6 6 5 9 3 9 0 6 9 9 8 1 6 8 8 0 3 1 5 3 3 0 5 6 4 8 1 9 9 2 6 0 2 8 4 5 5 9 3 8 9 7 9 9 3 2 3 5 6 0 6 8 7 5 1 0 9 7 2 7 6 7 5 5 5 4 8 4 0 2 8 8 5 5 5 4 5 1 6 2 9 4 2 2 2 1 7 9 1 8 9 6 8 4 4 9 4 2 8...
output:
12 27 57 43 66 147 95 207 438 37 30 117 40 152 462 163 420 1349 49 63 478 103 325 1659 355 982 4934 52 45 239 90 79 276 186 318 783 101 76 527 79 258 779 314 889 2436 166 409 1400 283 753 2691 1197 2951 9068 157 189 702 305 372 1037 565 965 2438 226 311 1307 333 1137 2630 1207 3041 7919 865 1190 485...
result:
ok single line: '12 27 57 43 66 147 95 207 438 ...24338505 2439757273 7341749283 '
Test #40:
score: 20
Accepted
time: 226ms
memory: 85952kb
input:
0 1 1 2 1 2 0 2 0 11 2 5 3 7 5 4 7 1 9 1 5 4 8 7 5 5 9 2 2 1 3 2 2 1 0 6 5 6 8 5 4 3 9 8 7 2 5 4 0 5 1 0 6 4 5 7 5 5 6 0 4 2 6 4 2 1 2 7 1 4 6 1 1 3 4 1 0 6 5 1 1 3 4 5 8 5 9 1 4 7 2 1 7 1 2 9 8 3 2 2 6 9 3 6 9 7 2 4 7 1 4 1 9 6 2 6 5 6 1 1 9 7 1 5 7 8 7 4 9 2 8 6 0 4 5 5 1 7 5 2 8 1 6 8 6 8 7 4 6 0...
output:
3395616 3378777 3363774 3737398 3693385 3647745 3317846 3475225 3495620 3493261 3673478 3600599 3612064 3585250 3560893 3547091 3573326 3531344 3287848 3504945 3476670 3577436 3499220 3573840 3314495 3456544 3479813 3658750 3591860 3655934 3570381 3491601 3488548 3401326 3454637 3562733 3750208 3537...
result:
ok single line: '3395616 3378777 3363774 373739...737905 3754309 3635021 3700432 '