QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#829856 | #9776. Best Friend, Worst Enemy | Kevin5307 | AC ✓ | 319ms | 31748kb | C++23 | 3.5kb | 2024-12-24 14:12:07 | 2024-12-24 14:12:07 |
Judging History
answer
//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int n;
int x[400400],y[400400];
int L=1;
map<pii,int> Mp;
int Manhattan(int a,int b)
{
return abs(x[a]-x[b])+abs(y[a]-y[b]);
}
int Chebyshev(int a,int b)
{
return max(abs(x[a]-x[b]),abs(y[a]-y[b]));
}
struct solver
{
int ind;
vector<int> cand1,cand2;
map<int,int> Mp;
int mx,mn;
int Answer;
solver(){}
solver(int _ind,int _cur)
{
Answer=0;
mx=0;
mn=inf;
for(int i=1;i<=_cur;i++) if(i!=_ind)
{
mx=max(mx,Manhattan(_ind,i));
mn=min(mn,Chebyshev(_ind,i));
}
for(int i=1;i<=_cur;i++) if(i!=_ind)
if(Manhattan(_ind,i)==mx)
cand1.pb(i);
for(int i=1;i<=_cur;i++) if(i!=_ind)
if(Chebyshev(_ind,i)==mn)
cand2.pb(i);
for(auto x:cand1) Mp[x]++;
for(auto x:cand2) Mp[x]++;
for(auto pr:Mp) Answer+=(pr.second==2);
ind=_ind;
}
void add(int _ind)
{
if(Manhattan(_ind,ind)>mx)
{
mx=Manhattan(_ind,ind);
for(auto x:cand1)
{
if(Mp[x]==2) Answer--;
Mp[x]--;
}
cand1.clear();
Mp[_ind]++;
cand1.pb(_ind);
}
else if(Manhattan(_ind,ind)==mx)
{
Mp[_ind]++;
cand1.pb(_ind);
}
if(Chebyshev(_ind,ind)<mn)
{
mn=Chebyshev(_ind,ind);
for(auto x:cand2)
{
if(Mp[x]==2) Answer--;
Mp[x]--;
}
cand2.clear();
Mp[_ind]++;
if(Mp[_ind]==2) Answer++;
cand2.pb(_ind);
}
else if(Chebyshev(_ind,ind)==mn)
{
Mp[_ind]++;
if(Mp[_ind]==2) Answer++;
cand2.pb(_ind);
}
}
~solver()
{
vector<int>().swap(cand1);
vector<int>().swap(cand2);
map<int,int>().swap(Mp);
}
};
vector<solver> vsv;
vector<int> vind;
int val[2][2];
void rebuild(int ind)
{
vsv.clear();
vind.clear();
Mp.clear();
for(int i=1;i<=ind;i++)
{
int x2=x[i]/L;
int y2=y[i]/L;
int val=Mp[pii(x2,y2)];
if(!val) Mp[pii(x2,y2)]=i;
else Mp[pii(x2,y2)]=-1;
}
for(auto pr:Mp)
if(~pr.second)
{
vind.pb(pr.second);
vsv.pb(pr.second,ind);
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for(int i=0;i<2;i++)
for(int j=0;j<2;j++)
val[i][j]=-inf;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x[i]>>y[i];
int x2=x[i]/L;
int y2=y[i]/L;
for(auto &x:vsv) x.add(i);
if(Mp.find(pii(x2,y2))==Mp.end())
{
Mp[pii(x2,y2)]=i;
vsv.pb(i,i);
vind.pb(i);
}
else if(~Mp[pii(x2,y2)])
{
int p=find(ALL(vind),Mp[pii(x2,y2)])-vind.begin();
vind.erase(vind.begin()+p);
vsv.erase(vsv.begin()+p);
Mp[pii(x2,y2)]=-1;
}
for(int a=0;a<2;a++)
for(int b=0;b<2;b++)
val[a][b]=max(val[a][b],(a?x[i]:-x[i])+(b?y[i]:-y[i]));
int mx=0;
for(int a=0;a<2;a++)
for(int b=0;b<2;b++)
mx=max(mx,val[a^1][b^1]+(a?x[i]:-x[i])+(b?y[i]:-y[i]));
if(mx>=L*8)
{
L*=2;
rebuild(i);
}
int Total=0;
for(auto &x:vsv) Total+=x.Answer;
cout<<Total<<'\n';
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 5620kb
input:
2 1 5 1 10
output:
0 2
result:
ok 2 number(s): "0 2"
Test #2:
score: 0
Accepted
time: 1ms
memory: 5836kb
input:
4 2 5 5 3 5 7 8 5
output:
0 2 4 4
result:
ok 4 number(s): "0 2 4 4"
Test #3:
score: 0
Accepted
time: 1ms
memory: 5620kb
input:
9 3 4 3 6 4 3 4 7 5 5 6 3 6 7 7 4 7 6
output:
0 2 1 0 4 5 6 7 8
result:
ok 9 numbers
Test #4:
score: 0
Accepted
time: 1ms
memory: 5624kb
input:
13 3 5 4 4 4 5 4 6 5 3 5 4 5 5 5 6 5 7 6 4 6 5 6 6 7 5
output:
0 2 4 7 2 2 5 2 2 3 3 4 4
result:
ok 13 numbers
Test #5:
score: 0
Accepted
time: 182ms
memory: 10392kb
input:
384010 200000 1000000 200000 1000001 199999 1000000 200001 1000000 200000 999999 200000 1000002 200002 1000000 200000 999998 199998 1000000 199997 1000000 200003 1000000 200000 999997 200000 1000003 199996 1000000 200004 1000000 200000 1000004 200000 999996 199995 1000000 200000 1000005 200000 99999...
output:
0 2 4 7 12 2 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 384010 numbers
Test #6:
score: 0
Accepted
time: 153ms
memory: 6928kb
input:
400000 4991900 4984622 5004814 4985991 5008541 4983572 4988786 4997631 4995878 5010759 5026284 4998073 5034229 5000047 4983273 5019232 5007885 4993982 5010953 5021220 5026656 5007819 4976562 5013785 4978425 4988215 5000231 4977049 4987937 5023473 5024616 5009522 5002045 4977502 4988899 5014905 49866...
output:
0 2 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 0 0 0 0 ...
result:
ok 400000 numbers
Test #7:
score: 0
Accepted
time: 319ms
memory: 30828kb
input:
399999 420000 500000 420001 500001 420002 500002 420003 500003 420004 500004 420005 500005 420006 500006 420007 500007 420008 500008 420009 500009 420010 500010 420011 500011 420012 500012 420013 500013 420014 500014 420015 500015 420016 500016 420017 500017 420018 500018 420019 500019 420020 500020...
output:
0 2 2 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 0 0 0 ...
result:
ok 399999 numbers
Test #8:
score: 0
Accepted
time: 156ms
memory: 31748kb
input:
400000 5000000 5000000 4637207 1362793 6296942 2296942 6971218 2971218 6214485 2214485 8086725 4086725 8414337 5585663 5685949 1685949 1702684 5702684 6472899 7527101 5941033 1941033 7192827 3192827 6379191 2379191 2347274 6347274 7180991 6819009 8685943 5314057 7160303 3160303 6928903 7071097 44215...
output:
0 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 400000 numbers
Test #9:
score: 0
Accepted
time: 86ms
memory: 6972kb
input:
399913 5000000 7000000 5000000 6000000 3000000 5000000 4000000 5000000 5000000 5000000 6000000 5000000 7000000 5000000 5000000 4000000 5000000 3000000 5357589 6392898 4901211 6444181 5188225 6102824 4788614 6242360 4802804 6288663 4734311 6103748 5031314 6227375 5100725 6211516 5247076 6358750 48076...
output:
0 2 1 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 0 0 0 ...
result:
ok 399913 numbers
Test #10:
score: 0
Accepted
time: 65ms
memory: 6936kb
input:
400000 3000000 8000000 3012636 7948165 6021732 4424572 3110512 7383392 2224678 6167889 6730174 3825314 2667414 7371648 3292265 6926643 2241546 6521035 6270139 1705913 4006880 6643854 4088241 6232389 3768770 6333837 3755946 6344466 6239447 3896690 7067142 2259147 2791441 7083567 2045838 6505125 72353...
output:
0 2 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 0 0 0 0 ...
result:
ok 400000 numbers
Test #11:
score: 0
Accepted
time: 58ms
memory: 6992kb
input:
400000 4000000 1000000 2000000 4000000 3971122 1730490 4198723 1332093 1891848 4399763 3883748 1754618 1318432 3775511 3824641 1583152 1718804 3837530 1992199 4221010 1863470 4175370 1634863 4587694 4261069 1328631 1796332 3690458 1611836 4116653 1635254 4407379 1317068 4297964 4046238 1937867 14548...
output:
0 2 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 0 0 0 0 ...
result:
ok 400000 numbers
Test #12:
score: 0
Accepted
time: 65ms
memory: 6780kb
input:
400000 4000003 1000001 2000003 4000001 1681540 4618492 1721680 4192318 1986524 4256472 1682732 4538323 1731436 4480115 1471609 3827694 1879802 4357249 1140557 4064455 1809962 4461028 4628899 1636633 1535641 3964206 1953510 3671812 1904251 3298566 4092976 1434705 1481816 4156505 1609477 4445491 36394...
output:
0 2 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 0 0 0 0 ...
result:
ok 400000 numbers
Test #13:
score: 0
Accepted
time: 85ms
memory: 6784kb
input:
400000 4999997 8000001 3999997 5000001 5999997 5000001 5217659 2801801 5912267 2981691 4977175 2078224 4984213 2609315 5732901 2796477 4700507 2763210 4857500 7076015 5146689 7537378 4975916 2227084 5335767 2678476 5297317 2382545 4938482 2612155 5002716 7491341 4254058 7030846 4488940 2584804 48196...
output:
0 2 2 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 0 0 0 ...
result:
ok 400000 numbers
Test #14:
score: 0
Accepted
time: 87ms
memory: 6772kb
input:
400000 4999998 7999993 3999998 4999993 5999998 4999993 4911385 2736908 5207358 7506133 5316688 2415833 4377390 7356539 5572531 2832663 5714897 7236169 4979803 2143629 4162191 2938526 4670816 7342922 4673690 7616930 5257771 2409424 5363441 7609733 5096353 7467363 5288304 7395497 4847351 2920398 49314...
output:
0 2 2 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 0 0 0 ...
result:
ok 400000 numbers
Test #15:
score: 0
Accepted
time: 240ms
memory: 7412kb
input:
381785 5000000 5000000 4999998 5000000 5000001 5000001 5000002 5000000 5000001 4999999 5000000 4999998 4999999 5000001 4999999 4999999 5000000 5000002 5000003 5000001 5000003 4999999 5000001 5000003 4999996 5000000 4999998 4999998 4999998 5000002 5000001 4999997 4999999 5000003 4999999 4999997 50000...
output:
0 2 1 1 2 3 3 4 4 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 381785 numbers
Test #16:
score: 0
Accepted
time: 114ms
memory: 6928kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Test #17:
score: 0
Accepted
time: 56ms
memory: 6704kb
input:
400000 1000568 5000255 1000132 4999980 1000533 4999684 1000547 4999977 4980604 8000000 1000405 4999821 1000471 4999645 1000393 5000195 1000520 5000355 1000499 4999653 1000329 5000235 1000590 5000281 1000577 4999772 1000111 4999960 1000419 5000408 1000589 4999499 1000443 5000383 1000519 4999953 10005...
output:
0 2 2 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 0 0 0 ...
result:
ok 400000 numbers
Test #18:
score: 0
Accepted
time: 115ms
memory: 7132kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Test #19:
score: 0
Accepted
time: 56ms
memory: 6764kb
input:
400000 1000541 4999918 1000333 4999730 1000399 4999825 1000399 5000033 1000565 4999952 1000473 5000367 1000406 4999735 1000437 5000266 1000600 4999825 1000556 4999830 1000596 5000282 1000417 4999850 1000582 5000260 4991889 8000000 4990475 2000000 1000534 5000400 1000563 4999657 1000433 4999610 10005...
output:
0 2 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 0 0 0 0 ...
result:
ok 400000 numbers
Test #20:
score: 0
Accepted
time: 48ms
memory: 6820kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 ...
result:
ok 400000 numbers
Test #21:
score: 0
Accepted
time: 56ms
memory: 6720kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Test #22:
score: 0
Accepted
time: 54ms
memory: 6728kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Test #23:
score: 0
Accepted
time: 52ms
memory: 6824kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 1 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 400000 numbers
Test #24:
score: 0
Accepted
time: 51ms
memory: 6984kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Test #25:
score: 0
Accepted
time: 60ms
memory: 6824kb
input:
400000 1000000 5000000 1000001 4999999 1000001 5000000 1000001 5000001 1000002 4999998 1000002 4999999 1000002 5000000 1000002 5000001 1000002 5000002 1000003 4999997 1000003 4999998 1000003 4999999 1000003 5000000 1000003 5000001 1000003 5000002 1000003 5000003 1000004 4999996 1000004 4999997 10000...
output:
0 2 4 7 2 2 5 2 2 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 400000 numbers
Extra Test:
score: 0
Extra Test Passed