QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#179220 | #2729. Flop Sorting | lmeowdn | 25 ✓ | 63ms | 7432kb | C++14 | 2.6kb | 2023-09-14 19:45:32 | 2023-09-14 19:45:32 |
Judging History
answer
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
const int N=4105;
int n,a1[N],a2[N];
vp p1,p2;
void merge(vp &p,int *a,int l,int r) {
if(l==r) return;
int x=l, y=r, z=0, mid=l;
while(mid<=r&&a[mid]<a[mid+1]) ++mid;
if(mid>r||mid==r&&a[r-1]<a[r]) return;
static int b[N];
rep(i,l,r) b[i]=a[i];
sort(b+l,b+r+1), z=b[mid];
while(x<=mid&&a[x]<=z) x++;
while(y>mid&&a[y]>z) y--;
//cout<<" merge "<<l<<" "<<r<<' '<<x<<" "<<y<<" "<<z<<endl;
//cout<<" "; rep(i,l,r) cout<<a[i]<<" "; puts("");
rep(i,0,mid-x) if(x+i<mid-i)
p.eb(x+i,mid-i), swap(a[x+i],a[mid-i]);
rep(i,0,y-mid-1) if(mid+1+i<y-i)
p.eb(mid+1+i,y-i), swap(a[mid+1+i],a[y-i]);
rep(i,0,mid-x)
p.eb(x+i,y-i), swap(a[x+i],a[y-i]);
merge(p,a,l,mid), merge(p,a,mid+1,r);
}
void work(vp &p,int *a,int l,int r) {
if(l==r) return; int mid=l+r>>1;
work(p,a,l,mid), work(p,a,mid+1,r);
//cout<<"WORK "<<l<<" "<<r<<": "; rep(i,l,r) cout<<a[i]<<" "; puts("");
merge(p,a,l,r);
//cout<<"WORK "<<l<<" "<<r<<": "; rep(i,l,r) cout<<a[i]<<" "; puts("");
}
signed main() {
n=read();
rep(i,1,n) a1[i]=read();
rep(i,1,n) a2[i]=read();
work(p1,a1,1,n);
//rep(i,1,n) cout<<a1[i]<<" "; puts("");
work(p2,a2,1,n);
printf("%d\n",(int)(p1.size()+p2.size()));
for(auto [x,y]:p1) printf("%d %d\n",x,y);
reverse(p2.begin(),p2.end());
for(auto [x,y]:p2) printf("%d %d\n",x,y);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 3748kb
input:
2 1 2 2 1
output:
1 1 2
result:
ok correct answer!
Test #2:
score: 0
Accepted
time: 1ms
memory: 4136kb
input:
100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 75 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 63 2...
output:
877 75 76 98 99 97 100 99 100 97 98 96 97 95 98 97 98 95 96 94 95 93 96 95 96 93 94 90 91 89 92 91 92 89 90 92 93 91 94 93 94 91 92 85 86 86 87 87 88 81 82 84 85 83 86 82 87 85 87 82 84 88 89 87 90 86 91 85 92 90 91 89 92 86 87 85 88 80 81 79 82 78 83 77 84 76 85 75 86 74 87 73 88 84 85 83 86 82 87 ...
result:
ok correct answer!
Test #3:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
100 2 29 34 38 5 67 46 94 93 83 13 86 32 47 37 11 99 79 95 84 78 44 91 48 23 8 25 1 19 30 33 75 58 50 24 28 98 57 22 68 100 21 56 39 9 35 40 72 76 55 80 36 20 60 82 27 88 49 97 71 16 43 31 7 45 4 53 6 42 89 77 52 61 10 51 17 26 41 74 73 14 66 87 63 92 64 54 96 70 85 69 3 15 90 12 62 18 81 59 65 1 2 ...
output:
902 6 7 4 5 3 4 2 3 8 9 9 10 8 9 12 13 9 10 11 12 9 12 10 11 8 9 9 10 12 13 11 12 6 7 8 9 6 9 7 8 4 5 6 7 4 7 5 6 3 4 14 15 15 16 14 15 17 18 18 19 20 21 21 22 20 21 23 24 24 25 23 24 21 22 23 24 21 24 22 23 20 21 17 19 20 22 17 22 18 21 19 20 16 17 15 16 17 18 21 22 23 24 21 24 22 23 20 21 24 25 23...
result:
ok correct answer!
Test #4:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
100 90 86 18 57 98 46 44 94 14 73 96 75 84 25 34 93 24 100 6 27 59 88 64 67 43 15 51 49 37 10 89 79 83 92 1 91 72 63 81 21 28 50 66 99 76 7 52 42 60 16 65 33 13 20 4 40 8 53 9 68 3 35 78 87 69 23 62 2 71 30 29 36 47 26 11 32 22 97 70 39 19 54 61 56 82 85 55 31 95 38 74 17 80 5 41 12 48 58 77 45 40 8...
output:
1757 1 2 1 2 3 4 1 4 2 3 5 6 6 7 5 6 3 4 5 6 3 6 4 5 2 3 3 4 8 9 9 10 11 12 12 13 10 11 11 12 5 7 8 10 5 10 6 9 7 8 4 5 3 4 2 3 1 2 10 11 9 10 8 9 11 12 12 13 18 19 17 18 15 16 17 18 15 18 16 17 14 15 15 16 24 25 23 24 22 23 21 22 23 24 24 25 18 19 20 21 18 21 19 20 17 18 20 21 22 23 20 23 21 22 22 ...
result:
ok correct answer!
Test #5:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 1 2 2 1
output:
1 1 2
result:
ok correct answer!
Test #6:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
2 1 2 2 1
output:
1 1 2
result:
ok correct answer!
Subtask #2:
score: 10
Accepted
Dependency #1:
100%
Accepted
Test #7:
score: 10
Accepted
time: 15ms
memory: 3976kb
input:
2048 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
61825 131 132 132 133 133 134 134 135 135 136 136 137 137 138 138 139 139 140 140 141 141 142 142 143 143 144 144 145 145 146 146 147 147 148 148 149 149 150 150 151 151 152 152 153 153 154 154 155 155 156 156 157 157 158 158 159 159 160 160 161 161 162 162 163 163 164 164 165 165 166 166 167 167 16...
result:
ok correct answer!
Test #8:
score: 0
Accepted
time: 16ms
memory: 4036kb
input:
2048 1056 1019 49 2042 1100 323 409 1849 974 957 1355 1207 564 1922 441 1124 665 879 276 637 481 578 1252 1401 1268 1384 1478 13 1485 82 1753 339 1108 1845 1762 1751 950 689 1935 988 272 901 707 1993 675 1248 961 1901 1307 731 1570 262 1488 1012 1058 893 220 465 534 837 1644 1005 1878 513 1502 703 1...
output:
62255 1 2 2 3 1 2 5 6 6 7 3 4 5 6 3 6 4 5 2 3 3 4 6 7 7 8 9 10 11 12 14 15 13 14 15 16 11 12 13 14 11 14 12 13 9 10 11 12 9 12 10 11 14 15 13 14 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 4 5 5 6 6 7 7 8 11 12 13 14 11 14 12 13 14 15 13 14 15 16 17 18 19 20 17 20 18 19 19 20 21 22 19 22 20 21 18 19 19 20...
result:
ok correct answer!
Test #9:
score: 0
Accepted
time: 8ms
memory: 3940kb
input:
2048 1 2 3 5 8 12 13 15 17 20 25 26 27 30 31 35 39 40 41 42 46 49 54 55 58 59 61 64 67 69 71 73 75 76 79 82 84 85 86 87 90 91 94 96 99 100 101 102 105 110 113 116 120 123 124 127 128 132 133 143 145 149 154 156 158 159 160 161 163 164 169 170 172 174 175 178 182 186 188 190 193 194 198 199 201 204 2...
output:
71746 1025 1026 1027 1028 1025 1026 1027 1028 1025 1028 1026 1027 1029 1030 1031 1032 1029 1030 1031 1032 1029 1032 1030 1031 1025 1028 1026 1027 1029 1032 1030 1031 1025 1032 1026 1031 1027 1030 1028 1029 1033 1034 1035 1036 1033 1034 1035 1036 1033 1036 1034 1035 1037 1038 1039 1040 1037 1038 1039...
result:
ok correct answer!
Test #10:
score: 0
Accepted
time: 4ms
memory: 3928kb
input:
2048 274 1169 1233 1420 165 1883 469 394 712 535 430 1138 1993 1850 1037 1083 532 1415 276 1508 345 1632 245 115 939 698 639 791 2046 943 654 147 1783 903 878 798 1072 1400 1839 1866 847 1999 739 569 110 705 302 221 248 1805 741 749 464 646 1476 1842 1706 845 839 1133 396 1906 732 1372 624 714 1378 ...
output:
71552 7 8 6 7 7 8 2 4 5 7 2 7 3 6 4 5 1 2 9 10 10 11 9 10 13 14 13 14 15 16 13 16 14 15 12 13 13 14 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 4 5 11 12 13 14 11 14 12 13 9 10 11 12 9 12 10 11 14 15 18 19 17 18 23 24 21 22 23 24 21 24 22 23 18 20 21 23 18 23 19 22 20 21 17 18 18 19 25 26 26 27 25 26 27 2...
result:
ok correct answer!
Test #11:
score: 0
Accepted
time: 12ms
memory: 4484kb
input:
2048 2048 1024 1536 512 1792 768 1280 256 1920 896 1408 384 1664 640 1152 128 1984 960 1472 448 1728 704 1216 192 1856 832 1344 320 1600 576 1088 64 2016 992 1504 480 1760 736 1248 224 1888 864 1376 352 1632 608 1120 96 1952 928 1440 416 1696 672 1184 160 1824 800 1312 288 1568 544 1056 32 2032 1008...
output:
124245 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 ...
result:
ok correct answer!
Test #12:
score: 0
Accepted
time: 8ms
memory: 4456kb
input:
2048 2048 1024 1536 512 1792 768 1280 256 1920 896 1408 384 1664 640 1152 128 1984 960 1472 448 1728 704 1216 192 1856 832 1344 320 1600 576 1088 64 2016 992 1504 480 1760 736 1248 224 1888 864 1376 352 1632 608 1120 96 1952 928 1440 416 1696 672 1184 160 1824 800 1312 288 1568 544 1056 32 2032 1008...
output:
114703 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 ...
result:
ok correct answer!
Test #13:
score: 0
Accepted
time: 14ms
memory: 3964kb
input:
2048 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 ...
output:
77942 76 77 77 78 78 79 79 80 80 81 81 82 82 83 83 84 84 85 85 86 86 87 87 88 88 89 89 90 90 91 91 92 92 93 93 94 94 95 95 96 96 97 97 98 98 99 99 100 100 101 101 102 102 103 103 104 104 105 105 106 106 107 107 108 108 109 109 110 110 111 111 112 112 113 113 114 114 115 115 116 116 117 117 118 118 1...
result:
ok correct answer!
Test #14:
score: 0
Accepted
time: 14ms
memory: 4104kb
input:
2048 2048 1024 1536 512 1792 768 1280 256 1920 896 1408 384 1664 640 1152 128 1984 960 1472 448 1728 704 1216 192 1856 832 1344 320 1600 576 1088 64 2016 992 1504 480 1760 736 1248 224 1888 864 1376 352 1632 608 1120 96 1952 928 1440 416 1696 672 1184 160 1824 800 1312 288 1568 544 1056 32 2032 1008...
output:
93346 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 1...
result:
ok correct answer!
Test #15:
score: 0
Accepted
time: 12ms
memory: 4356kb
input:
2035 232 604 108 1681 1329 1518 1018 968 1764 178 940 932 615 911 618 1855 871 1410 1667 750 1367 100 641 807 1099 387 1278 821 494 1233 1062 1713 1293 1105 1601 1421 540 544 1695 620 310 756 1322 2030 1292 1721 1450 378 1849 370 1395 155 1069 405 1819 908 90 1422 1178 959 1351 1332 194 1816 2017 12...
output:
103879 2 3 1 2 7 8 5 6 7 8 5 8 6 7 4 5 5 6 6 7 7 8 9 10 11 12 10 11 11 12 14 15 10 12 13 15 10 15 11 14 12 13 4 8 5 7 9 13 10 12 4 13 5 12 6 11 7 10 8 9 3 4 2 3 13 14 12 13 11 12 10 11 9 10 19 20 18 19 17 18 21 22 22 23 23 24 18 20 21 23 18 23 19 22 20 21 17 18 18 19 23 24 22 23 25 26 27 28 26 27 30...
result:
ok correct answer!
Test #16:
score: 0
Accepted
time: 13ms
memory: 4464kb
input:
2037 1963 1717 326 418 803 764 1966 1581 741 1258 1940 1651 1352 940 1317 372 1334 1576 654 1242 1450 1502 347 352 881 1344 332 1086 1385 1816 1795 1608 1428 1786 1182 1681 1667 561 353 984 1275 614 1589 188 732 1224 763 99 1044 1220 1365 1633 1423 58 755 1776 1595 28 238 1900 366 1489 577 1623 92 1...
output:
104414 1 2 1 2 3 4 1 4 2 3 5 6 7 8 3 4 5 6 3 6 4 5 6 7 5 6 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 13 14 15 16 13 16 14 15 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 10 12 13 15 10 15 11 14 12 13 9 10 10 11 15 16 14 15 17 18 19 20 17 20 18 19 21 22...
result:
ok correct answer!
Test #17:
score: 0
Accepted
time: 12ms
memory: 4412kb
input:
2047 1237 1466 1161 1855 1955 5 1208 1634 452 1585 182 134 252 880 1150 1826 1204 1379 189 1671 1422 673 1977 247 831 1217 1301 330 1828 96 1025 91 1136 1338 2001 2046 1072 370 610 2014 1669 644 718 1937 1529 1145 1899 597 694 1885 670 1644 95 128 498 1995 1893 297 576 1633 137 565 859 1944 1304 169...
output:
104538 2 3 1 2 5 6 6 7 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 11 12 9 10 11 12 9 12 10 11 12 13 11 12 13 14 14 15 3 8 4 7 5 6 9 14 10 13 11 12 3 14 4 13 5 12 6 11 7 10 8 9 2 3 3 4 4 5 5 6 6 7 7 8 13 14 15 16 13 16 14 15 12 13 18 19 17 18 21 22 23 24 22 23 21 22 19 20 21 22 19 22 20 21 18 19 19 20 22 23...
result:
ok correct answer!
Test #18:
score: 0
Accepted
time: 12ms
memory: 4452kb
input:
2048 1283 1643 1012 1661 111 1616 1513 1354 53 1540 1602 1081 992 336 98 1595 1938 1098 946 1926 224 1002 345 825 63 870 1331 952 1535 1269 1690 360 895 691 1197 424 1581 1090 1380 1804 1738 238 934 803 955 1923 860 939 1422 1962 1421 654 827 2005 120 1700 587 1570 486 971 2047 1827 184 115 1006 908...
output:
105221 2 3 1 2 7 8 6 7 7 8 3 4 5 6 3 6 4 5 2 3 1 2 5 6 7 8 5 8 6 7 11 12 10 11 13 14 14 15 13 14 10 12 13 15 10 15 11 14 12 13 15 16 4 8 5 7 9 13 10 12 4 13 5 12 6 11 7 10 8 9 2 3 4 5 2 5 3 4 1 2 2 3 4 5 6 7 4 7 5 6 7 8 11 13 14 16 11 16 12 15 13 14 17 18 18 19 17 18 19 20 22 23 23 24 18 20 21 23 18...
result:
ok correct answer!
Subtask #3:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #19:
score: 10
Accepted
time: 45ms
memory: 4412kb
input:
4096 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 3815 90 91 92 93 94 95 96 97 98 99 100 1...
output:
146107 89 90 90 91 91 92 92 93 93 94 94 95 95 96 96 97 97 98 98 99 99 100 100 101 101 102 102 103 103 104 104 105 105 106 106 107 107 108 108 109 109 110 110 111 111 112 112 113 113 114 114 115 115 116 116 117 117 118 118 119 119 120 120 121 121 122 122 123 123 124 124 125 125 126 126 127 127 128 18...
result:
ok correct answer!
Test #20:
score: 0
Accepted
time: 63ms
memory: 4628kb
input:
4096 360 3709 3751 3190 3157 4040 3985 3628 3104 1368 241 1983 1283 687 1969 2370 3736 2670 2732 955 373 2279 3919 3448 2616 3838 2385 3177 3210 3145 2186 1617 297 53 1540 2259 3150 2094 3068 1623 908 3344 1311 201 1746 548 2578 535 1528 2981 3192 1468 495 1308 504 2426 2836 681 843 1564 782 3179 66...
output:
141191 3 4 2 3 7 8 6 7 7 8 3 4 5 6 3 6 4 5 2 3 9 10 10 11 9 10 11 12 13 14 11 12 13 14 11 14 12 13 10 11 11 12 14 15 13 14 15 16 2 8 3 7 4 6 9 15 10 14 11 13 2 15 3 14 4 13 5 12 6 11 7 10 8 9 1 2 15 16 14 15 13 14 12 13 11 12 10 11 9 10 17 18 19 20 18 19 17 18 19 20 23 24 19 20 21 22 19 22 20 21 18 ...
result:
ok correct answer!
Test #21:
score: 0
Accepted
time: 17ms
memory: 4592kb
input:
4096 1 5 6 7 8 10 12 13 17 20 21 22 24 25 29 30 31 32 36 37 38 41 42 45 46 49 50 51 52 54 59 66 67 69 70 72 75 78 79 82 84 85 86 89 91 92 93 98 99 100 101 102 107 108 115 117 118 119 121 122 123 124 125 127 129 130 133 136 139 140 141 142 145 146 147 148 150 151 153 154 155 157 158 159 160 166 167 1...
output:
169209 2049 2050 2051 2052 2049 2050 2051 2052 2049 2052 2050 2051 2053 2054 2055 2056 2053 2054 2055 2056 2053 2056 2054 2055 2049 2052 2050 2051 2053 2056 2054 2055 2049 2056 2050 2055 2051 2054 2052 2053 2057 2058 2059 2060 2057 2058 2059 2060 2057 2060 2058 2059 2061 2062 2063 2064 2061 2062 206...
result:
ok correct answer!
Test #22:
score: 0
Accepted
time: 19ms
memory: 5104kb
input:
4096 514 1174 2556 2207 1278 1582 2624 242 2206 1420 1367 2049 1734 1461 3646 1049 3320 1134 1443 1685 2247 1351 1611 4050 268 1646 1924 1453 3135 1500 1925 3956 2098 3385 1717 1895 667 1291 287 4092 4032 2693 908 3650 1093 797 760 630 723 2681 1010 1508 146 2899 3897 917 863 248 720 2340 202 3074 2...
output:
168721 3 4 7 8 6 7 5 6 3 4 5 6 3 6 4 5 2 3 1 2 6 7 5 6 9 10 10 11 9 10 11 12 13 14 15 16 14 15 13 14 11 12 13 14 11 14 12 13 10 11 9 10 14 15 13 14 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 4 5 3 4 10 12 13 15 10 15 11 14 12 13 17 18 18 19 19 20 21 22 22 23 19 20 21 22 19 22 20 21 18 19 22 23 27 28 26 2...
result:
ok correct answer!
Test #23:
score: 0
Accepted
time: 30ms
memory: 7432kb
input:
4096 4096 2048 3072 1024 3584 1536 2560 512 3840 1792 2816 768 3328 1280 2304 256 3968 1920 2944 896 3456 1408 2432 384 3712 1664 2688 640 3200 1152 2176 128 4032 1984 3008 960 3520 1472 2496 448 3776 1728 2752 704 3264 1216 2240 192 3904 1856 2880 832 3392 1344 2368 320 3648 1600 2624 576 3136 1088...
output:
296747 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 ...
result:
ok correct answer!
Test #24:
score: 0
Accepted
time: 18ms
memory: 6240kb
input:
4096 4096 2048 3072 1024 3584 1536 2560 512 3840 1792 2816 768 3328 1280 2304 256 3968 1920 2944 896 3456 1408 2432 384 3712 1664 2688 640 3200 1152 2176 128 4032 1984 3008 960 3520 1472 2496 448 3776 1728 2752 704 3264 1216 2240 192 3904 1856 2880 832 3392 1344 2368 320 3648 1600 2624 576 3136 1088...
output:
274778 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 ...
result:
ok correct answer!
Test #25:
score: 0
Accepted
time: 46ms
memory: 5592kb
input:
4096 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 ...
output:
178160 251 252 250 251 249 250 248 249 247 248 246 247 245 246 244 245 243 244 242 243 241 242 240 241 239 240 238 239 237 238 236 237 235 236 234 235 233 234 232 233 231 232 230 231 229 230 228 229 227 228 226 227 225 226 224 225 223 224 222 223 221 222 220 221 219 220 218 219 217 218 216 217 215 2...
result:
ok correct answer!
Test #26:
score: 0
Accepted
time: 42ms
memory: 6088kb
input:
4096 4096 2048 3072 1024 3584 1536 2560 512 3840 1792 2816 768 3328 1280 2304 256 3968 1920 2944 896 3456 1408 2432 384 3712 1664 2688 640 3200 1152 2176 128 4032 1984 3008 960 3520 1472 2496 448 3776 1728 2752 704 3264 1216 2240 192 3904 1856 2880 832 3392 1344 2368 320 3648 1600 2624 576 3136 1088...
output:
214156 1 2 3 4 2 3 1 2 3 4 5 6 7 8 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 9 10 11 12 10 11 9 10 11 12 13 14 15 16 14 15 13 14 15 16 11 12 13 14 11 14 12 13 10 11 9 10 11 12 14 15 13 14 15 16 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 5 6 7 8 11 12 13 14 11 14 ...
result:
ok correct answer!
Test #27:
score: 0
Accepted
time: 21ms
memory: 5776kb
input:
4083 2516 341 2006 237 3273 517 15 529 1890 3290 3380 3330 3085 1115 2010 2645 2828 3818 2375 2936 531 3725 2799 893 896 450 1526 2704 2382 4065 892 1954 268 1142 3186 1348 1340 1550 2318 1934 979 2282 2005 2692 959 1885 1315 1178 3819 2599 1661 563 2741 2688 3815 2002 2878 3301 3253 1920 4038 260 9...
output:
251374 1 2 3 4 2 3 1 2 3 4 5 6 6 7 5 6 7 8 3 4 5 6 3 6 4 5 2 3 1 2 6 7 5 6 11 12 13 14 14 15 15 16 10 12 13 15 10 15 11 14 12 13 9 10 15 16 14 15 13 14 7 8 9 10 7 10 8 9 6 7 7 8 10 11 9 10 11 12 12 13 18 19 17 18 19 20 23 24 22 23 23 24 18 20 21 23 18 23 19 22 20 21 17 18 18 19 23 24 25 26 29 30 31 ...
result:
ok correct answer!
Test #28:
score: 0
Accepted
time: 25ms
memory: 5816kb
input:
4085 2991 2833 2759 1930 202 3134 1983 2198 2226 3594 3916 405 3285 3335 2460 1773 78 3527 2827 1865 456 3711 836 1223 686 2905 605 256 2170 3115 2781 594 2758 1144 2079 3474 995 1528 3411 683 3894 3579 240 3369 3945 808 89 2306 719 135 547 2047 3344 2110 1844 2056 1249 2246 2191 1684 3794 2587 3252...
output:
251659 1 2 3 4 1 2 3 4 1 4 2 3 6 7 7 8 2 4 5 7 2 7 3 6 4 5 1 2 11 12 10 11 9 10 15 16 13 14 15 16 13 16 14 15 11 12 13 14 11 14 12 13 10 11 13 14 15 16 13 16 14 15 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 3 4 19 20 18 19 19 20 22 23 23 24 18 20 21 23 18 23 19 22 20 21 27 28 25 26 27...
result:
ok correct answer!
Test #29:
score: 0
Accepted
time: 29ms
memory: 5916kb
input:
4095 1260 3048 1648 2595 3467 2724 3418 3396 329 3187 3166 2501 1492 522 399 2627 168 3664 3817 2047 26 3220 2961 598 2936 2222 3973 3753 493 1225 2559 674 2547 2086 2484 3225 957 4090 2943 444 1401 1693 3473 3144 1733 2326 2403 3114 2212 3189 3314 386 3850 475 2663 2050 1653 494 2857 2581 3222 3184...
output:
252182 2 3 3 4 5 6 7 8 6 7 7 8 4 5 11 12 10 11 11 12 13 14 14 15 13 14 10 12 13 15 10 15 11 14 12 13 15 16 14 15 4 8 5 7 9 13 10 12 4 13 5 12 6 11 7 10 8 9 1 3 4 6 1 6 2 5 3 4 6 7 5 6 7 8 11 13 14 16 11 16 12 15 13 14 10 11 9 10 19 20 18 19 23 24 22 23 23 24 19 20 21 22 19 22 20 21 18 19 17 18 19 20...
result:
ok correct answer!
Test #30:
score: 0
Accepted
time: 26ms
memory: 5680kb
input:
4096 2835 1747 1101 930 3802 1980 308 3842 3608 1255 3276 3940 1355 398 3266 118 3920 2613 2042 2011 3065 1078 3787 3250 2868 3272 3966 2911 1147 1941 1675 895 484 3653 1776 1732 2356 798 2025 2461 341 1026 2491 762 3379 2161 2039 1008 3815 95 824 3277 769 2347 4065 641 3567 3791 3827 3180 607 3298 ...
output:
252226 1 2 3 4 1 2 3 4 1 4 2 3 5 6 6 7 5 6 4 5 3 4 2 3 1 2 5 6 9 10 10 11 13 14 15 16 14 15 13 14 10 12 13 15 10 15 11 14 12 13 9 10 10 11 15 16 14 15 13 14 5 8 6 7 9 12 10 11 5 12 6 11 7 10 8 9 3 4 5 6 3 6 4 5 2 3 1 2 3 4 6 7 7 8 11 12 13 14 11 14 12 13 14 15 13 14 17 18 19 20 17 18 19 20 17 20 18 ...
result:
ok correct answer!
Extra Test:
score: 0
Extra Test Passed