比赛 20161114 评测结果 WWWWWWWWWW
题目名称 欺负萌新的Rapiz 最终得分 0
用户昵称 Tabing010102 运行时间 4.327 s
代码语言 C++ 内存使用 0.29 MiB
提交时间 2016-11-14 09:25:14
显示代码纯文本
#include <cstdio>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef long long LL;
const int RT = 5500;
FILE *fin, *fout;
double n, qwy, qwh;
int main() {
	srand(time(NULL));
	fin = fopen("solo.in", "r");
	fout = fopen("solo.out", "w");
//	fout = stdout;
	fscanf(fin, "%lf", &n);
	/*
	for(int i = 1; i <= RT; i++) {
		double tmp;
		tmp = (double)rand()/RAND_MAX;
		LL r1 = tmp*n;
		tmp = (double)rand()/RAND_MAX;
		LL r2 = tmp*n;
		qwy += r1&r2;
		qwh += r1|r2;
	}*/
//	time_t s = clock();
	double evv=n/RT;
	for(int i = 1; i <= RT; i++) {
		for(int j = 1; j <= RT; j++) {
			LL r1=evv*i, r2=evv*j;
			qwy += r1&r2;
			qwh += r1|r2;
		}
	}
	qwy /= (double)RT*RT;
	qwh /= (double)RT*RT;
	fprintf(fout, "%.6e\n%.6e\n", qwy, qwh);
//	time_t e = clock();
//	printf("Run Time:%.3lfs\n", (double)(e-s)/1000);
	return 0;
}