SUOI #69 奔跑的Aqua

这个题……不会啊

0.001模拟可以发现一些规律

请教了一下物理dalao

设泽尔帝跑出去 \(L\) ,Aqua用时 \(T\) ,初距 \(X\)

\(\int_{0}^{T}V_A\sin\theta(t)\ dt\ =\ L\)

\(\int_{0}^{T}(V_A-V_Z\sin\theta(t))\ dt\ =\ X\)

#include <cstdio>
#include <algorithm>

using std::swap;

const int MOD=1075757;

inline int Norm(int a){
	return (a%MOD+MOD)%MOD;
}

int sr;
int sum(int a, int b){
	sr=a+b;
	if(sr>=MOD)	sr-=MOD;
	return sr;
}

int mul(int a, int b){
	return (int)((1LL*a*b)%(1LL*MOD));
}

int T;
int Inv[MOD];

struct Pos{
	int x, y;
	Pos(){}
	Pos(int _x, int _y){x=_x;y=_y;}
	void read(){
		scanf("%d%d", &x, &y);
		x=Norm(x);y=Norm(y);
	}
	void show(){
		printf("%d %d\n", x, y);
	}
} A, Z, D, Ans;

Pos operator + (Pos A, Pos B){
	return Pos(sum(A.x, B.x), sum(A.y, B.y));
}

Pos operator - (Pos A, Pos B){
	return Pos(sum(A.x, MOD-B.x), sum(A.y, MOD-B.y));
}

Pos operator * (Pos A, int k){
	return Pos(mul(A.x, k), mul(A.y, k));
}

int Va, Vz;
int K, Len;

int main(){
	
	Inv[0]=1;Inv[1]=1;
	for(int i=2;i<MOD;++i)	Inv[i]=mul(Inv[MOD%i], MOD-MOD/i);
	
	scanf("%d", &T);
	
	while(T--){
		
		A.read();Z.read();
		scanf("%d%d", &Va, &Vz);
		
		K=mul(Va, Inv[Vz]);
		K=mul(K, mul(Inv[sum(K, MOD-1)], Inv[sum(K, 1)]));
		
		D=Z-A;swap(D.x, D.y);D.x=MOD-D.x;D=D*K;
		
		Ans=Z+D;
		
		Len=sum(mul(D.x, D.x), mul(D.y, D.y));
		Len=mul(Len, mul(Inv[Vz], Inv[Vz]));
		
		printf("%d\n", Len);
		Ans.show();
		
	}
	
	return 0;
}
posted @ 2019-01-18 20:24  Pickupwin  阅读(162)  评论(1编辑  收藏  举报