QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#71944 | #5371. Matrix | Crysfly | 100 ✓ | 667ms | 4056kb | C++17 | 1.6kb | 2023-01-12 18:37:47 | 2023-01-12 18:37:50 |
Judging History
answer
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 2000005
#define inf 0x3f3f3f3f
int n,a[66][66],s1[66],s2[66];
bool chk(){
For(i,1,n)For(j,1,n)if(a[i][j])return 0;
return 1;
}
int bel[66],vis[66],q[66];
bool dfs(int u){
if(vis[u])return 0;
vis[u]=1;
For(i,1,n)
if(a[u][i]){
if(!bel[i])return bel[i]=u,1;
if(dfs(bel[i]))return bel[i]=u,1;
}
return 0;
}
void work()
{
n=read();
For(i,0,n)s1[i]=s2[i]=0;
For(i,1,n)For(j,1,n)a[i][j]=read(),s1[i]+=a[i][j],s2[j]+=a[i][j];
For(i,1,n)if(s1[i]!=s1[1])return puts("-1"),void();
For(i,1,n)if(s2[i]!=s2[1])return puts("-1"),void();
For(i,1,n)For(j,1,n)if(a[i][j]<0)return puts("-1"),void();
vector<vi>out;
while(!chk()){
For(i,0,n)bel[i]=0;
For(i,1,n){
For(j,1,n)vis[j]=0;
dfs(i);
}
int mn=inf;
For(i,1,n){
assert(bel[i]&&a[bel[i]][i]);
mn=min(mn,a[bel[i]][i]);
q[bel[i]]=i;
}
vi o; o.pb(mn);
For(i,1,n)o.pb(q[i]);
out.pb(o);
For(i,1,n)a[bel[i]][i]-=mn;
}
cout<<out.size()<<"\n";
for(auto it:out){
for(auto x:it)cout<<x<<" ";
cout<<"\n";
}
}
signed main()
{
int T=read();
while(T--)work();
return 0;
}
詳細信息
Subtask #1:
score: 30
Accepted
Test #1:
score: 30
Accepted
time: 0ms
memory: 3456kb
input:
10 5 41 18467 6334 26500 2995 19169 15724 11478 29358 -21392 26962 24464 5705 28145 -30939 23281 16827 9961 491 3777 -15116 -21145 20859 -30157 99896 5 4827 5436 32391 14604 1869 3902 153 292 12382 42398 17421 18716 19718 19895 -16623 5447 21726 14771 11538 5645 27530 13096 -8045 708 25838 5 41879 4...
output:
-1 -1 17 23080 5 4 3 2 1 4393 5 2 4 3 1 21401 5 4 1 3 2 12484 4 5 1 3 2 1116 1 5 4 3 2 2064 1 4 5 3 2 29062 1 3 5 4 2 14794 2 1 5 4 3 18414 2 1 4 5 3 5516 4 1 2 5 3 9303 2 3 5 1 4 301 1 2 5 3 4 8273 1 2 3 5 4 27056 3 2 5 1 4 1063 1 3 2 5 4 6191 3 1 2 5 4 8106 4 3 2 1 5 -1 -1 -1 -1 -...
result:
ok good solution (10 test cases)
Test #2:
score: 0
Accepted
time: 2ms
memory: 3316kb
input:
10 5 59894 57729 53053 37667 58044 49556 41863 58059 44760 72149 49555 42862 54181 52697 67092 55846 40495 51765 66802 51479 51536 83438 49329 64461 17623 5 6224 11008 5844 32609 13458 14989 32702 3195 20485 -2228 3093 14343 30523 1587 19597 29314 9503 7448 25200 -2322 15523 1587 22133 -10738 40638 ...
output:
17 40495 5 4 3 2 1 11041 5 2 4 3 1 4265 5 4 1 3 2 36459 4 5 1 3 2 8831 3 5 1 4 2 13686 1 5 3 4 2 20197 1 3 5 4 2 2243 5 1 2 4 3 21845 2 1 5 4 3 25241 2 1 4 5 3 26011 1 3 2 5 4 227 3 1 2 5 4 10643 2 3 5 1 4 14407 3 2 5 1 4 13173 3 5 2 1 4 1208 4 3 2 1 5 16415 3 2 4 1 5 -1 17 42238 5 ...
result:
ok good solution (10 test cases)
Test #3:
score: 0
Accepted
time: 5ms
memory: 3344kb
input:
10 5 10202 3625 26477 4414 17773 9314 25824 29334 25874 -27855 24372 20159 11833 28070 -21943 7487 28297 7518 8177 11012 11116 -15414 -12671 -4044 83504 5 80335 81240 95764 92557 91633 81674 87052 107785 86199 78819 83374 82671 109099 81197 85188 80115 80496 89595 108544 82779 116031 110070 39286 73...
output:
-1 17 80496 5 4 3 2 1 11137 5 2 4 3 1 24398 4 2 5 3 1 54060 4 5 1 3 2 24759 3 5 1 4 2 4555 4 3 1 5 2 26696 1 3 5 4 2 5703 1 4 2 5 3 33583 2 1 5 4 3 47936 1 3 2 5 4 24585 2 1 3 5 4 511 2 3 5 1 4 4018 4 2 3 1 5 47499 3 2 4 1 5 22561 2 3 4 1 5 5526 4 3 2 1 5 23506 3 1 2 4 5 -1 -1 -1 17...
result:
ok good solution (10 test cases)
Test #4:
score: 0
Accepted
time: 2ms
memory: 3468kb
input:
10 5 22335 24708 38072 45631 16687 27829 32738 19360 45510 21996 22430 32748 37233 30145 24877 38308 18739 18383 18259 53744 36531 38500 34385 7888 30129 5 44671 57452 39279 47542 49809 36827 56746 58358 41115 45707 57345 54779 56063 52429 18137 37825 52474 36230 66538 45686 62085 17302 48823 31129 ...
output:
17 16687 5 4 3 2 1 2052 4 5 3 2 1 17792 4 2 5 3 1 591 4 5 1 3 2 18259 3 5 1 4 2 3580 4 3 1 5 2 16070 1 4 3 5 2 6265 1 4 2 5 3 21616 4 1 2 5 3 6213 2 1 4 5 3 291 2 5 4 1 3 7085 3 2 5 1 4 803 3 5 2 1 4 4064 3 4 2 1 5 2424 2 4 3 1 5 7861 3 2 4 1 5 15780 2 3 4 1 5 17 41115 5 4 3 2 1 11...
result:
ok good solution (10 test cases)
Test #5:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
10 5 14423 3527 11600 26969 1588 14015 5565 28 21543 16956 25347 2088 2943 12637 15092 22409 26463 5049 4681 -495 -18087 20464 38487 -7723 24966 5 608 32060 21221 1758 18035 29954 20888 14146 690 8004 7949 12843 21430 25620 5840 748 27067 4536 20783 20548 34423 -19176 12349 24831 21255 5 64025 55878...
output:
-1 -1 17 44916 5 4 3 2 1 7283 5 4 1 3 2 39339 4 5 1 3 2 16996 5 1 4 2 3 19654 4 1 5 2 3 23414 2 1 5 4 3 6705 1 5 2 4 3 30602 3 5 2 1 4 6910 1 2 5 3 4 24420 1 3 2 5 4 11879 4 3 2 1 5 3597 4 2 3 1 5 26080 2 3 4 1 5 20719 1 2 4 3 5 6384 2 3 1 4 5 28091 3 2 1 4 5 5271 1 2 3 4 5 -1 -1 -1...
result:
ok good solution (10 test cases)
Test #6:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
10 5 18115 1679 17110 25898 28 23073 788 23977 18132 -3140 29956 28689 26113 10008 -31936 12941 15790 1723 21363 11013 -21255 15884 -6093 -12571 86865 5 127174 109596 107467 104281 105705 124370 103467 113729 125263 87394 128549 116691 134564 123221 51198 112072 118025 131046 104994 88086 62058 1064...
output:
-1 17 62058 5 4 3 2 1 43647 5 4 1 3 2 62797 4 5 1 3 2 41484 4 1 5 2 3 14483 1 5 4 2 3 9714 1 2 5 4 3 1736 1 5 2 4 3 82886 3 1 2 5 4 5200 3 2 1 5 4 8378 3 5 2 1 4 11003 3 4 2 1 5 8555 2 4 3 1 5 84136 2 3 4 1 5 24602 1 2 4 3 5 16905 2 3 1 4 5 12688 1 3 2 4 5 63951 1 2 3 4 5 -1 -1 -1 1...
result:
ok good solution (10 test cases)
Test #7:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
10 5 18337 1278 12393 7636 25608 30714 28164 31591 19949 -45166 19135 2505 13337 10004 20271 16337 2623 28664 9970 7658 -19271 30682 -20733 17693 56881 5 118623 106427 108494 117715 101283 127994 107536 109218 123168 84626 127738 106914 105591 113982 98317 128516 118161 100285 131953 73627 49671 113...
output:
-1 17 49671 5 4 3 2 1 51612 5 4 1 3 2 48673 4 5 1 3 2 13219 3 5 1 4 2 68490 4 1 5 2 3 29827 2 1 5 4 3 552 4 1 2 5 3 22734 1 5 2 4 3 7351 1 4 2 5 3 29125 3 1 2 5 4 14234 3 2 1 5 4 22365 1 2 3 5 4 14534 2 4 3 1 5 62066 2 3 4 1 5 51916 3 2 4 1 5 47152 1 3 2 4 5 19021 1 2 3 4 5 17 62791...
result:
ok good solution (10 test cases)
Test #8:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
10 5 32179 16595 20169 2327 25783 12042 31310 28182 11058 14461 7926 9487 1670 32528 45442 5651 2258 7213 9860 72071 39255 37403 39819 41280 -60704 5 58360 64228 60090 62746 84076 74052 61459 76336 59121 58532 70485 80483 66556 57499 54477 64875 78368 84232 74216 27809 61728 44962 42286 75918 104606...
output:
-1 17 59121 5 4 3 2 1 2607 4 5 3 2 1 44962 4 5 1 3 2 16640 5 1 4 2 3 25646 2 1 5 4 3 28831 1 2 5 3 4 10439 1 5 2 3 4 19090 1 3 2 5 4 8719 2 3 1 5 4 524 2 5 3 1 4 8315 5 3 2 1 4 15177 4 3 2 1 5 32628 3 2 4 1 5 8231 2 3 4 1 5 16804 2 3 1 4 5 27462 3 1 2 4 5 4304 2 1 3 4 5 -1 -1 -1 17 ...
result:
ok good solution (10 test cases)
Test #9:
score: 0
Accepted
time: 2ms
memory: 3456kb
input:
10 5 27577 12750 14007 23729 29929 24081 2995 2678 24676 53562 27753 20899 11784 15565 31991 3093 13608 6172 11243 73876 25488 57740 73351 32779 -81366 5 10168 5055 11191 5973 15469 8922 6748 5651 10986 15549 2144 16446 31577 26517 -28828 14629 29916 5874 15791 -18354 11993 -10309 -6437 -11411 64020...
output:
-1 -1 17 34633 5 4 3 2 1 7468 3 5 4 2 1 7477 5 2 4 3 1 13216 5 4 1 3 2 5105 4 5 1 3 2 7061 4 3 1 5 2 3349 1 4 5 3 2 1284 1 3 5 4 2 32256 2 1 5 4 3 18414 2 1 4 5 3 10902 1 3 2 5 4 5169 2 3 5 1 4 21513 3 2 5 1 4 5256 3 2 4 1 5 21370 4 3 2 1 5 1425 4 1 2 3 5 17757 1 2 4 3 5 -1 -1 17 67...
result:
ok good solution (10 test cases)
Test #10:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
10 5 52175 34573 47184 34242 48829 39726 48464 56486 42655 29672 58676 54948 45757 42343 15279 45044 49757 42978 51268 27956 21382 29261 24598 46495 95267 5 115939 94609 88842 92104 98792 89855 95791 96911 101968 105761 111710 103031 92884 106351 76310 116598 114955 95676 118795 44262 56184 81900 11...
output:
17 21382 5 4 3 2 1 21273 5 4 1 3 2 7988 4 5 1 3 2 6174 5 1 4 2 3 15279 4 1 5 2 3 3145 4 1 2 5 3 6922 1 5 3 2 4 13717 1 5 2 3 4 24811 1 3 2 5 4 1045 2 5 3 1 4 7830 4 3 2 1 5 36169 3 2 4 1 5 11015 3 2 1 4 5 18400 2 3 1 4 5 5445 1 3 2 4 5 15128 2 1 3 4 5 1280 1 2 3 4 5 17 56184 5 4 3 2...
result:
ok good solution (10 test cases)
Subtask #2:
score: 30
Accepted
Dependency #1:
100%
Accepted
Test #11:
score: 30
Accepted
time: 60ms
memory: 3544kb
input:
10 30 3303373 3309415 3289962 3309855 3312694 3291644 3309691 3294908 3296047 3312358 3320956 3313078 3317639 3306313 3317589 3316838 3308551 3311957 3312323 3293346 3313147 3293374 3301630 3308503 3311855 3315564 3317401 3290456 3301303 3309428 3308147 3304361 3303158 3313330 3307333 3299369 330747...
output:
842 3288487 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 774 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 6 8 7 5 4 3 2 1 130 30 29 28 27 26 25 24 21 23 22 20 19 18 17 16 15 14 13 12 11 10 9 6 8 7 5 4 3 2 1 315 30 29 28 27 24 26 25 21 23 22 ...
result:
ok good solution (10 test cases)
Test #12:
score: 0
Accepted
time: 27ms
memory: 3560kb
input:
10 30 25858 20543 5081 5580 21407 4436 27670 29662 22863 9166 16463 29055 6598 15772 19331 1861 28300 18493 12041 30649 23644 4237 13082 7619 30667 10463 28816 32610 32042 667 12619 18413 30880 8108 31306 18847 4806 21452 13696 29571 23500 6377 10456 26535 21011 1587 6102 84 14423 7883 22313 25932 2...
output:
-1 -1 842 268171 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 67602 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 2 52 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 8 10 9 7 6 5 4 1 3 2 4032 30 29 28 27 26 25 22 24...
result:
ok good solution (10 test cases)
Test #13:
score: 0
Accepted
time: 57ms
memory: 3596kb
input:
10 30 28707 13868 14465 24416 8093 17673 21579 21031 5918 2118 16786 18578 20313 2650 17225 4826 19578 8273 30101 19104 14183 11785 20783 22729 7238 31393 32267 3468 29247 10437 10543 14647 32457 20611 10673 20997 8349 29837 13895 620 19507 32168 12447 9900 10461 433 29616 6193 11107 24350 28075 122...
output:
-1 -1 842 1694822 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 2787 30 29 28 27 26 25 24 23 20 22 21 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1089 30 29 28 27 26 25 24 23 20 22 21 17 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 2883 30 29 28 27 26 25 24 ...
result:
ok good solution (10 test cases)
Test #14:
score: 0
Accepted
time: 31ms
memory: 3548kb
input:
10 30 1877980 1884839 1882787 1892166 1890951 1884275 1871379 1889209 1880359 1875952 1886153 1873742 1878142 1881827 1884743 1885969 1876926 1862856 1889254 1866118 1888937 1874026 1869339 1878240 1884919 1891248 1888760 1871219 1876216 1872740 1864122 1869302 1866860 1862522 1876780 1882353 187564...
output:
842 1862024 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 3810 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 13 15 14 12 11 10 9 8 7 6 5 4 3 2 1 1819 30 29 28 27 24 26 25 23 22 21 20 19 18 17 16 13 15 14 12 11 10 9 8 7 6 5 4 3 2 1 5087 30 29 28 27 24 26 25 23 22 ...
result:
ok good solution (10 test cases)
Test #15:
score: 0
Accepted
time: 16ms
memory: 3484kb
input:
10 30 16839 13517 8633 13614 10134 22456 18487 28474 24349 13661 725 9203 30073 11768 23094 32129 24571 17959 21191 30634 20521 15079 235 13147 2310 4543 10325 10372 6548 20066 31035 27316 10793 8342 3484 18838 28855 32154 21966 32646 7828 4919 3226 29816 29433 32404 2589 20840 7940 26665 24953 3052...
output:
-1 842 220300 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 2463 30 29 28 27 26 25 24 23 22 21 20 19 16 18 17 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1476 30 29 28 27 26 25 24 23 22 21 20 19 16 18 17 15 14 13 12 11 10 7 9 8 6 5 4 3 2 1 572 30 29 26 28 27 25 24 23 22...
result:
ok good solution (10 test cases)
Test #16:
score: 0
Accepted
time: 60ms
memory: 3532kb
input:
10 30 19376 24875 436 7136 15860 6690 16841 19439 18717 25060 32008 30692 27748 16860 16892 13232 27975 9628 22979 16522 29299 6700 23057 26337 17895 6050 6264 11413 599 1746 2291 25318 15206 12238 1545 8559 2989 5016 29718 17740 10058 14175 39 10532 6365 27540 10236 18059 23353 18705 17687 25801 23...
output:
-1 842 2997701 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 4640 30 29 28 25 27 26 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 360 30 29 28 25 27 26 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 5 7 6 4 3 2 1 2531 30 29 28 25 27 26 24 23 2...
result:
ok good solution (10 test cases)
Test #17:
score: 0
Accepted
time: 42ms
memory: 3548kb
input:
10 30 10892 13184 20058 14812 27543 16465 28755 20969 9156 10257 21633 28245 8668 10484 153 32019 24280 20383 10231 6169 12452 28383 5255 23222 6692 16283 5861 8486 23669 8512 15623 16835 26212 11637 4379 29836 13375 14213 9540 31046 22960 18061 11097 14781 23403 17985 13008 20446 21172 30115 7730 3...
output:
-1 -1 842 188060 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 16637 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 2 1102 30 29 28 27 26 25 24 23 22 21 20 19 18 17 14 16 15 13 12 11 10 9 8 7 6 5 4 1 3 2 982 30 27 29 28 26 25 24 2...
result:
ok good solution (10 test cases)
Test #18:
score: 0
Accepted
time: 68ms
memory: 3572kb
input:
10 30 353867 334928 355743 337736 334462 337276 345871 362849 344375 360835 335013 343263 341571 356111 359479 359116 354004 335254 340524 363907 337191 344696 350783 339559 352099 361543 355713 355284 343493 339053 340069 356765 338774 355322 356053 339296 334873 365004 354379 362105 339361 343809 ...
output:
842 278526 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 55723 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 2 1203 30 29 28 27 26 25 24 23 22 21 20 19 18 17 14 16 15 13 12 11 10 9 8 7 6 5 4 1 3 2 3601 30 29 28 27 26 25 24 23 22 ...
result:
ok good solution (10 test cases)
Test #19:
score: 0
Accepted
time: 46ms
memory: 3504kb
input:
10 30 5709452 5704663 5724623 5729417 5719012 5717741 5700474 5728774 5728826 5709004 5728123 5713004 5720585 5724565 5712061 5725452 5720374 5725736 5731570 5720547 5730454 5732248 5729841 5714100 5724849 5708509 5711844 5718107 5701573 5727506 5705929 5731041 5719133 5702414 5709374 5715159 571360...
output:
842 5701391 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 2370 30 27 29 28 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 3317 30 29 26 28 27 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 443 30 29 26 28 27 23 25 24 22 2...
result:
ok good solution (10 test cases)
Test #20:
score: 0
Accepted
time: 46ms
memory: 3616kb
input:
10 30 25953 10308 12139 19252 16910 9492 29364 32108 15210 31797 18930 28429 22716 17633 10315 23598 25869 24586 25781 4741 16270 5941 11632 9947 2868 7563 21715 7870 421 13190 10029 23372 25206 27991 2761 23203 2874 3830 8555 13950 24995 29191 22677 13866 8288 29900 10897 27544 20268 1895 28934 298...
output:
-1 842 182769 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1376 30 29 28 27 26 25 24 23 22 21 20 19 16 18 17 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1683 30 29 28 27 26 25 24 23 20 22 21 19 16 18 17 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 352 29 30 28 27 26 25 24 23 20...
result:
ok good solution (10 test cases)
Subtask #3:
score: 40
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #21:
score: 40
Accepted
time: 501ms
memory: 3948kb
input:
10 50 419554 436616 427584 414027 433924 422395 436901 424493 439408 428738 440682 431561 430102 416162 417686 442910 436427 444329 440657 419013 417681 441441 438342 434122 422169 416074 432459 428218 434310 428423 415044 415229 425844 440792 424260 423526 423737 412872 442870 444169 423786 433960 ...
output:
2401 315684 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 97171 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 2...
result:
ok good solution (10 test cases)
Test #22:
score: 0
Accepted
time: 492ms
memory: 3944kb
input:
10 50 893584 892076 893457 905314 916705 899138 904688 906790 901046 893594 911521 893478 920506 893380 911302 900111 905268 890103 910984 911352 901166 894248 910297 916376 893654 910299 898556 889782 918308 904250 907080 900576 918205 907876 913449 911968 906264 896263 901735 899692 892895 910641 ...
output:
2401 888501 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 150 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 29 31 30 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 ...
result:
ok good solution (10 test cases)
Test #23:
score: 0
Accepted
time: 499ms
memory: 4056kb
input:
10 50 23486 29609 28134 10595 26557 19436 11414 25127 32057 29024 6852 19258 14689 8198 2495 8391 6023 5749 27664 16445 8230 6350 7330 25325 2339 8177 8487 26324 11091 2289 27574 6581 28990 22726 24505 14956 8994 26690 7686 9342 13371 3143 23628 23028 30018 3638 19377 24426 20532 27055 2218 21177 77...
output:
-1 -1 2402 2979532 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 571 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 28 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 ...
result:
ok good solution (10 test cases)
Test #24:
score: 0
Accepted
time: 495ms
memory: 4052kb
input:
10 50 10996 18902 32589 6979 31301 19649 11828 18646 7915 16872 25518 11991 2525 6524 17917 13839 11784 12991 20261 26881 16953 9823 15858 12503 23100 2818 6204 24219 6982 26658 8810 21674 3984 19227 28725 25702 23877 12930 29359 13356 25758 17337 10115 16774 2379 32448 19838 21409 11030 11660 25678...
output:
-1 2402 389909 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 30 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 25 27 26 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1...
result:
ok good solution (10 test cases)
Test #25:
score: 0
Accepted
time: 648ms
memory: 3892kb
input:
10 50 11330 28076 18669 6622 31581 9367 8116 27182 14014 28360 18539 25965 17175 13490 1543 3526 30910 4330 24092 4758 18793 28379 3253 1219 29494 443 28547 9551 25838 10174 11323 557 14218 3465 5689 21843 24822 9705 5993 23056 1046 18885 8295 3232 519 5201 25573 2046 12455 26222 20357 24910 30201 2...
output:
-1 2402 333697 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 915 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 ...
result:
ok good solution (10 test cases)
Test #26:
score: 0
Accepted
time: 349ms
memory: 3844kb
input:
10 50 31555 13006 13431 12875 32085 10200 14808 29166 22364 13874 962 22154 32443 27583 24156 23098 10605 31138 32012 20063 24739 3155 16955 5196 9902 27122 13400 20035 13344 19164 17439 7329 4142 8317 18459 15189 2137 15973 20841 5014 19278 6557 15808 5590 11018 4667 10926 28657 19009 16618 31540 1...
output:
-1 -1 -1 -1 -1 2402 1810085 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1069 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 11 13 12 10 9 ...
result:
ok good solution (10 test cases)
Test #27:
score: 0
Accepted
time: 667ms
memory: 3920kb
input:
10 50 29624 7488 2066 21388 18109 16375 8405 2508 6308 2448 11876 10581 19369 31971 27525 30692 27749 6838 8756 29334 12879 28725 20549 28670 27010 27036 32588 10357 10689 15671 21434 6321 32440 652 5960 29338 25988 18903 17049 4184 17270 18358 18970 7601 14868 26918 12846 27538 31841 27426 25518 11...
output:
-1 2402 4291324 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 83904 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1...
result:
ok good solution (10 test cases)
Test #28:
score: 0
Accepted
time: 647ms
memory: 3984kb
input:
10 50 550703 537292 527994 521360 522463 533104 537524 524721 544587 542970 547042 525564 537900 520023 550931 537043 523176 532509 526161 525479 532925 541028 531239 543596 527075 524503 545376 528970 526573 542219 532240 542870 539953 532239 540889 537088 529640 547652 541799 522254 550104 542830 ...
output:
2402 520395 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 896 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 4 6 5 3 2 1 ...
result:
ok good solution (10 test cases)
Test #29:
score: 0
Accepted
time: 326ms
memory: 3948kb
input:
10 50 370458 377258 360959 361509 367278 363730 372508 381002 376334 361610 374444 372917 388548 384964 380454 374282 369842 386925 372246 375997 359252 362655 371579 372957 371781 382743 360558 377904 377349 365545 362501 379525 381433 363634 389495 372806 387251 386447 372353 376653 363380 370444 ...
output:
2402 322986 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 36497 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 1 3 2...
result:
ok good solution (10 test cases)
Test #30:
score: 0
Accepted
time: 324ms
memory: 3856kb
input:
10 50 936 10063 1380 11699 21521 3659 30222 24609 20420 373 3076 26909 2159 16341 28164 26884 8013 7881 12480 9035 1354 22940 14374 27319 1640 32602 15844 7632 9313 29411 8492 18323 1166 12607 25524 14439 29959 21041 30722 11090 19724 30479 17638 19309 11427 7120 584 11669 24451 12473 32359 21283 47...
output:
-1 -1 -1 -1 -1 2402 1289262 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 43 50 49 48 47 46 45 44 43 42 41 38 40 39 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 ...
result:
ok good solution (10 test cases)