POJ 1945 暴搜+打表 (Or 暴搜+判重)
思路:
呃呃 暴搜+打表
暴搜的程序::稳稳的TLE+MLE (但是我们可以用来打表)
然后我们就可以打表过了 hiahiahia可以证明最小的那个数不会超过200(怎么证明的我也不知道),然后就直接判重就好了
打表:
打表的程序:
// by SiriusRen
#include <queue>
#include <cstdio>
#include <algorithm>
using namespace std;
queue<pair<int,int> >q;
int mod=100000007,vis[100000070],cnt=0,v[20005];
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int main()
{
freopen("data.txt","w",stdout);
vis[10008]=1;
q.push(make_pair(1,1));
while(!q.empty())
{
pair<int,int>t=q.front();q.pop();
int rec=vis[(t.first*10007+t.second)%mod];
if(!v[t.first])v[t.first]=rec,cnt++;
if(!v[t.second])v[t.second]=rec,cnt++;
if(cnt==20000)goto e;
//first+second & first
if(t.first+t.second<=20000&&!vis[((t.first+t.second)*10007+t.first)%mod])
{
vis[((t.first+t.second)*10007+t.first)%mod]=rec+1;
q.push(make_pair(t.first+t.second,t.first));
}
//first+second & second
if(t.first+t.second<=20000&&!vis[((t.first+t.second)*10007+t.second)%mod])
{
vis[((t.first+t.second)*10007+t.second)%mod]=rec+1;
q.push(make_pair(t.first+t.second,t.second));
}
//fisrt-second & first
if(t.first-t.second>t.first&&!vis[((t.first-t.second)*10007+t.first)%mod])
{
vis[((t.first-t.second)*10007+t.first)%mod]=rec+1;
q.push(make_pair(t.first-t.second,t.first));
}
if(t.first-t.second<t.first&&t.first-t.second>0&&!vis[(t.first*10007+t.first-t.second)%mod])
{
vis[(t.first*10007+t.first-t.second)%mod]=rec+1;
q.push(make_pair(t.first,t.first-t.second));
}
//first-second & second
if(t.first-t.second>t.second&&!vis[((t.first-t.second)*10007+t.second)%mod])
{
vis[((t.first-t.second)*10007+t.second)%mod]=rec+1;
q.push(make_pair(t.first-t.second,t.second));
}
if(t.first-t.second<t.second&&t.first-t.second>0&&!vis[(t.second*10007+t.first-t.second)%mod])
{
vis[(t.second*10007+t.first-t.second)%mod]=rec+1;
q.push(make_pair(t.second,t.first-t.second));
}
//first+first & first
if((t.first*2)<=20000&&!vis[(t.first*2*10007+t.first)%mod])
{
vis[(t.first*2*10007+t.first)%mod]=rec+1;
q.push(make_pair(t.first+t.first,t.first));
}
//first+first & second
if((t.first*2)<=20000&&!vis[(t.first*2*10007+t.second)%mod])
{
vis[(t.first*2*10007+t.second)%mod]=rec+1;
q.push(make_pair(t.first+t.first,t.second));
}
//second+second & first
if((t.second*2)<=20000&&t.second*2>=t.first&&!vis[(t.second*2*10007+t.first)%mod])
{
vis[(t.second*2*10007+t.first)%mod]=rec+1;
q.push(make_pair(t.second<<1,t.first));
}
if((t.second*2)<=20000&&t.second*2<t.first&&!vis[(t.first*10007+t.second*2)%mod])
{
vis[(t.first*10007+t.second*2)%mod]=rec+1;
q.push(make_pair(t.first,t.second*2));
}
}
e:for(int i=0;i<=20000;i++)
{
printf("%c",v[i]+'A');
}
}
大概十几秒打完了表。
// by SiriusRen
#include <cstdio>
int p;
char ans[]={"ABCDDEEFEFFGFGGGFGGHGHHHGHHHHIHHGHHIHIIIHIIIIIIIHIIIIJIJIJJJIJIIHIIJIJJJIJJJJJJJIJJJJJJKJKJKJJJJIJJJJKJKJKKKJKKKJKKKKKKKJKKKJKJJIJJKJKKKJKKKKKKKJKKKKKKLKKKKKKKKJKKKKKKLKLKLKLLLKLLLKLLLKLKLKKKKJKKKKLKLKLLLKLLLKLLLLLLLKLLLLLLLKLLLLLLLLLLLLLLLKLLLLLLLKLLLKLKKJKKLKLLLKLLMLMLLKLLMLMLLLLLLLLLLKLLLLLLMLLLMLMMMLMLMLMLMLMLLLLLLKLLLLLLMLMLMLMMMLMMMLMMMLMMMMMMMLMMMMMMMLMMMMMMMLMMMLMMMLMLMLLLLKLLLLMLMLMMMLMMMLMMMMMMMLMMMMMMMLMMMMMMMMMMMMMMMLMMMMMMMMMMMMMMMLMMMMMMMMMMMMNMNMMMNMNMMMMMMMMMMLMMMMMMMMMMNMNMMLMMNMNMMLMMMLMLLKLLMLMMMLMMNMNMMLMMNMNNMMNNNMNMMLMMNMNNNMMNNMNMNMMMNMNMMMNMMMMMMLMMMMMMNMMMNMNNNMNMNMNNNMNNNNNNNMNNNMNNNMNNNMNNNMNNNMNMNMNMMMMMMLMMMMMMNMNMNMNNNMNNNMNNNMNNNNNNNMNNNNNNNMNNNNNNNMNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNMNNNNNNNMNNNNNNNMNNNMNNNMNMNMMMMLMMMMNMNMNNNMNNNMNNNNNNNMNNNNNNNMNNNNNNNNNNONNNNMNNNNONNNNNNNNNNMNNNNNNNNNNNNNNONNNONONNNONNNNNNMNNNNNNONNNONONNNONONONNNNNNNNNNMNNNNNNNNNNONONONONONONONOOONOOONONONOOONOOONONONNNONONNNNNNNNNNMNNNNNNNNNNONONNNNNONOOONOOONONNMNNONOOONOOONONNMNNONONNMNNNMNMMLMMNMNNNMNNONONNMNNONOOONOOONONNMNNONOOONOOOOONNNNOOOOONNOOONONNMNNONOOONNOOOOOONNNOOOOONOOONOOONONONOOONOOONONONOOONONNNONNNNNNMNNNNNNONNNONOOONONONOOONOOOOOOONOOONOOONOOOOOOONOOOOOOOOOOOOOOONOOOOOOONOOOOOOONOOOOOOONOOOOOOONOOOOOOONOOONOOONOOONONONONNNNNNMNNNNNNONONONOOONOOONOOONOOOOOOONOOOOOOONOOOOOOONOOOOOOOOOOOOOOONOOOOOOOOOOOOOOONOOOOOOOOOOOOOOPNOOOOPOPOOOOOPOPOOOOOOOOOOOOOOOONOOOOOOOOOOOOOOOOOOPOPOOOOOOOOOONOOOOOOOOOOPOPOOOOOOOOOOOOOOOOOONOOOOOOOOOOOOOOONOOOOPOOOPOPOPOONOOPOOOONOOOOPOONOOONOOONONONNNNMNNNNONONOOONOOONOOPOOOONOOOOPOONOOPOPOOOPOPOOOONOOOOPOOOOOOOOOONOOOOOOPOOOPOOOOOOOPOPPOOOOPOOOONOOOOPOPOOPPOPOO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SSSTSTSTTTTTSSTTSSTTSTSTSSTTSTSSSTSTSTTTSTTTSTSTTSTTSTSTSTSTSTSTSTTTSTSTSSSTSTTSTTSTSSTTSSSSSTSTSSSSSTSSSTSSSSSSSTSSSSSSSSSSRSSSSSSSSSSTSSSSSSSTSSTTSSSSSTSTSSSSSTSSSTSTSSTTSTSSSTSTSTTTSTTTSTSTSTSTSTTSTTSTSTTTSTTTSTSTTTTTSTTSSTSTSSTTSTTTSTSTTTTTSTTTTTTTSTTTSTTTSTSTSTTTSTTTSTSTSTTTSTTTSTTTSTTTSTSTSTTTSTTTSTTTSTTTSTTTSTTTSTSTSTTTSTSTSTSTSTSTSTSTSTSTSTSTSTSSSSSTSSSTSSSSSSSSSSSSSSSSRSSSSSSSSSSSSSSSSTSSSTSSSSSTSTSTSTSTSTSTSTSSSTSSSTSTSTTTSTTTSTTTSTTTSTTTSTSTSSTTSTTSSTTTSTTTSTSTSTTTSSSTSTTTSTSSSTTTSTSSSTSSSSSSRSSSSSSTSSSTSTTTSSSTSTTTSTTSTTTTSTSTSTTTSTSTTSSTSTTSTTSTSTTTSTTTSTSTSTSTSTTTSTTTSSSTSSTSSTSSSTSTSSSTTSSTSTSTSTSTSSTTSTSSTTSSTSTTRTTSSSSTSSSTSTTSSTSTSTTTSSTTTTSSSTSSSSSTSSSSTTSTSTTTSSTTTTTTSTSTSTSTSTSTSTSTSSTTSTSSTTSTSTTTSTTTSSSTSTTTSTTTSTTTSSTTSTSTSTSSSSSSRSSSSSSTSTSTSTTSSTTTSTTTSTSTTTSSSTSTSTTTSTTTSSTTSTSTSTTTSTTTSTSTSTSTSTTTSTSSSSTTSSSTSTSTSSSTSSSTSSSSSSSTSSTSSSSSSSSSSTSSSSSSSSSSRSSSSSSSSSSTSSSSSSSSSSSSSTSSSTSSS"};
int main()
{
scanf("%d",&p);
printf("%d",ans[p]-'A'-1);
}
然后就可以A此题了……
(转换成char类型可以少写无数逗号,省code length) Code length有30000B的限制
正解:
// by SiriusRen
#include <queue>
#include <cstdio>
#include <algorithm>
using namespace std;
queue<pair<int,int> >q;
char vis[20005][205];
int p;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int main()
{
vis[1][1]=1;
scanf("%d",&p);
q.push(make_pair(1,1));
while(!q.empty())
{
pair<int,int>t=q.front();q.pop();
int rec=vis[t.first][t.second]+1,mul=t.first<<1,mul2=t.second<<1,sum=t.first+t.second,minu=t.first-t.second;
if(p%(gcd(t.first,t.second)))continue;
if(t.first==p||t.second==p){printf("%d\n",rec-2);return 0;}
//first+second & first
if(t.first<=200&&sum<=20000&&!vis[sum][t.first])
{
vis[sum][t.first]=rec;
q.push(make_pair(sum,t.first));
}
//first+second & second
if(sum<=20000&&!vis[sum][t.second])
{
vis[sum][t.second]=rec;
q.push(make_pair(sum,t.second));
}
//fisrt-second & first
if(t.first<=200&&minu>t.first&&!vis[minu][t.first])
{
vis[minu][t.first]=rec;
q.push(make_pair(minu,t.first));
}
else if(minu<=200&&minu<t.first&&minu>0&&!vis[t.first][minu])
{
vis[t.first][t.first-t.second]=rec;
q.push(make_pair(t.first,t.first-t.second));
}
//first-second & second
if(t.first-t.second>t.second&&!vis[t.first-t.second][t.second])
{
vis[t.first-t.second][t.second]=rec;
q.push(make_pair(t.first-t.second,t.second));
}
else if(t.first-t.second<t.second&&t.first-t.second>0&&!vis[t.second][t.first-t.second])
{
vis[t.second][t.first-t.second]=rec;
q.push(make_pair(t.second,t.first-t.second));
}
//first+first & first
if(t.first<=200&&(mul)<=20000&&!vis[mul][t.first])
{
vis[mul][t.first]=rec;
q.push(make_pair(mul,t.first));
}
//first+first & second
if((mul)<=20000&&!vis[mul][t.second])
{
vis[mul][t.second]=rec;
q.push(make_pair(mul,t.second));
}
//second+second & first
if(t.first<=200&&(mul2)<=20000&&mul2>=t.first&&!vis[mul2][t.first])
{
vis[mul2][t.first]=rec;
q.push(make_pair(t.second<<1,t.first));
}
else if(mul2<=200&&(mul2)<=20000&&mul2<t.first&&!vis[t.first][mul2])
{
vis[t.first][mul2]=rec;
q.push(make_pair(t.first,mul2));
}
}
}
(STL毁一生… 本地秒出结果 POJ挂得特惨)
改成手写的队列……
// by SiriusRen
#include <cstdio>
#include <algorithm>
using namespace std;
char vis[20005][205];
int p,q1[5000000],q2[5000000],l=0,r=1;
int main()
{
scanf("%d",&p);
vis[1][1]=1;
q1[0]=q2[0]=1;
while(l<r)
{
int t1=q1[l];
int t2=q2[l++];
int rec=vis[t1][t2]+1,mul=t1<<1,mul2=t2<<1,sum=t1+t2,minu=t1-t2;
if(t1==p||t2==p){printf("%d\n",rec-2);return 0;}
//first+second & first
if(t1<=200&&sum<=20000&&!vis[sum][t1])
{
vis[sum][t1]=rec;
r++;q1[r]=sum;q2[r]=t1;
}
//first+second & second
if(sum<=20000&&!vis[sum][t2])
{
vis[sum][t2]=rec;
r++;q1[r]=sum;q2[r]=t2;
}
//first-second & first
if(t1<=200&&minu>t1&&!vis[minu][t1])
{
vis[minu][t1]=rec;
r++;q1[r]=minu;q2[r]=t1;
}
else if(minu<=200&&minu<t1&&minu>0&&!vis[t1][minu])
{
vis[t1][minu]=rec;
r++;q1[r]=t1;q2[r]=minu;
}
//first-second & second
if(minu>t2&&!vis[minu][t2])
{
vis[minu][t2]=rec;
r++;q1[r]=minu;q2[r]=t2;
}
else if(minu<t2&&minu>0&&!vis[t2][minu])
{
vis[t2][minu]=rec;
r++;q1[r]=t2;q2[r]=minu;
}
//first+first & first
if(t1<=200&&mul<=20000&&!vis[mul][t1])
{
vis[mul][t1]=rec;
r++;q1[r]=mul;q2[r]=t1;
}
//first+first & second
if(mul<=20000&&!vis[mul][t2])
{
vis[mul][t2]=rec;
r++;q1[r]=mul;q2[r]=t2;
}
//second+second & first
if(t1<=200&&mul2<=20000&&mul2>=t1&&!vis[mul2][t1])
{
vis[mul2][t1]=rec;
r++;q1[r]=mul2;q2[r]=t1;
}
else if(mul2<=200&&mul2<=20000&&mul2<t1&&!vis[t1][mul2])
{
vis[t1][mul2]=rec;
r++;q1[r]=t1;q2[r]=mul2;
}
}
}
坑爹搜索 跪一晚上,,,,,,