QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#106942#6412. Classical Geometry Problembulijiojiodibuliduo#WA 2ms3660kbC++1.5kb2023-05-19 20:53:522023-05-19 20:53:55

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-19 20:53:55]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3660kb
  • [2023-05-19 20:53:52]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

db dis(db x,db y,db z) {
	return sqrt(x*x+y*y+z*z);
}
void solve() {
	int x,y,z;
	scanf("%d%d%d",&x,&y,&z);
	int fx=0,fy=0,fz=0;
	if (x>127) x=255-x,fx=1;
	if (y>127) y=255-y,fy=1;
	if (z>127) z=255-z,fz=1;
	db scal=255./(255-z);
	vector<pair<array<int,3>,db>> ans;
	ans.pb(mp(array<int,3>{fx,fy,fz},1000.));
	auto solve2=[&](db x, db y) {
		int gx=0,gy=0;
		if (x>=127.5) x=255-x,gx=1;
		if (y>=127.5) y=255-y,gy=1;
		db s2=255./(255-y);
		ans.pb(mp(array<int,3>{1^fx^gx,fy^gy,fz},x*s2));
		ans.pb(mp(array<int,3>{fx^gx,1^fy^gy,fz},dis(x*(s2-1),y,0)));
	};
	solve2(x*scal,y*scal);
	ans.pb(mp(array<int,3>{fx,fy,1^fz},dis(x*(scal-1),y*(scal-1),z)));
	printf("%d\n",SZ(ans));
	for (auto [p,t]:ans) {
		printf("%d %d %d %.10f\n",255*p[0],255*p[1],255*p[2],t);
	}
}

int _;
int main() {
	for (scanf("%d",&_);_;_--) {
		solve();
	}
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3660kb

input:

3
105 255 175
174 174 174
0 0 0

output:

4
0 255 255 1000.0000000000
0 255 255 102.0000000000
255 0 255 0.0000000000
0 255 0 93.2952303175
4
255 255 255 1000.0000000000
0 255 255 222.0967741935
255 0 255 157.4191668372
255 255 0 96.9774205427
4
0 0 0 1000.0000000000
255 0 0 0.0000000000
0 255 0 0.0000000000
0 0 255 0.0000000000

result:

wrong answer too far from the target: (0.000000, 255.000000, 161.704770) instead of (105, 255, 175) (test case 1)