东莞网站设计百年,在国内做网站网站代理,西安网站建设公司电话,写作网站推荐传送门 文章目录题意#xff1a;思路#xff1a;题意#xff1a;
给你x0,y0,ax,ay,bx,byx_0,y_0,a_x,a_y,b_x,b_yx0,y0,ax,ay,bx,by#xff0c;让后根据[ax∗xi−1bx,ay∗yi−1by][a_x*x_{i-1}b_x,a_y*y_{i-1}b_y][ax∗xi−1bx,ay∗yi−1by]构造出…传送门
文章目录题意思路题意
给你x0,y0,ax,ay,bx,byx_0,y_0,a_x,a_y,b_x,b_yx0,y0,ax,ay,bx,by让后根据[ax∗xi−1bx,ay∗yi−1by][a_x*x_{i-1}b_x,a_y*y_{i-1}b_y][ax∗xi−1bx,ay∗yi−1by]构造出一堆有价值的点让后有个起点sx,sys_x,s_ysx,sy以及时间ttt每次可以往相邻位置移动一格消耗111秒时间问能获得最多的价值是多少。
思路
注意到ax,ay2a_x,a_y2ax,ay2这个很重要一开始没看见感觉很难就开始摆烂了 所以点数不会超过63个也就是很少而且点的排列方式一定是按照x,yx,yx,y递增的所以我们只需要确定起点和终点让后跑就行了。因为点数很少所以直接暴力枚举起点终点检查答案即可。
//#pragma GCC optimize(2)
#includecstdio
#includeiostream
#includestring
#includecstring
#includemap
#includecmath
#includecctype
#includevector
#includeset
#includequeue
#includealgorithm
#includesstream
#includectime
#includecstdlib
#define L (u1)
#define R (u1|1)
#define pb push_back
#define mk make_pair
#define Mid (tr[u].ltr[u].r1)
#define Len(u) (tr[u].r-tr[u].l1)
#define random(a,b) ((a)rand()%((b)-(a)1))
#define db puts(---)
using namespace std;//void rd_cre() { freopen(d://dp//data.txt,w,stdout); srand(time(NULL)); }
//void rd_ac() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//AC.txt,w,stdout); }
//void rd_wa() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//WA.txt,w,stdout); }typedef long long LL;
typedef unsigned long long ULL;
typedef pairint,int PII;const int N1000010,mod1e97,INF0x3f3f3f3f;
const double eps1e-6;
const LL M30000000000000000;int tot;
LL ax,ay,bx,by,sx,sy,t;
struct Node
{LL x,y;
}a[20000];LL get_dis(int i,int j)
{return abs(a[i].x-a[j].x)abs(a[i].y-a[j].y);
}int main()
{
// ios::sync_with_stdio(false);
// cin.tie(0);LL x0,y0; tot0;scanf(%lld%lld%lld%lld%lld%lld,x0,y0,ax,ay,bx,by);scanf(%lld%lld%lld,sx,sy,t);a[tot]{x0,y0};while(1){if(a[tot].xM||a[tot].yM) break;a[tot]{a[tot-1].x*axbx,a[tot-1].y*ayby};}a[tot1]{sx,sy};int ans0;for(int i1;itot;i)for(int j1;jtot;j)if(get_dis(i,tot1)get_dis(i,j)t)ansmax(ans,abs(i-j)1);printf(%d\n,ans);return 0;
}
/**/