Cena以及Lemon SpecialJudge的姿势
JDFZOJ的SPJ模板

八中OJ的SPJ模板

shinbokuow posted @ Aug 19, 2015 09:17:09 AM in Something with tags 奇怪の姿势 , 1402 阅读

RT.

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define OJ_AC 0
#define OJ_WA 1
#define OJ_PE 5
#define eps 1e-6
double out[1010],ans[1010];
int main(int argc,char*argv[]){
	FILE*fin,*fans,*fout;
	fin=fopen(argv[1],"r");
	fans=fopen(argv[2],"r");
	fout=fopen(argv[3],"r");
	int n,i,j;
	fscanf(fin,"%d",&n);
	for(i=1;i<=n;++i)
		fscanf(fans,"%lf",&ans[i]);
	for(i=1;i<=n;++i)
		fscanf(fout,"%lf",&out[i]);
	int ok=0;
	for(i=1;i<=n;++i){
		if(fabs(ans[i])<eps)
			ok+=fabs(out[i])<eps;
		else
			ok+=(fabs(ans[i]-out[i])/ans[i])<eps;
	}
	double _p=ok/(double)n,p=5;
	for(i=1;i<=7;++i)
		p*=_p;
	int score=int(p);
	if(score!=5)
		return OJ_WA;
	return OJ_AC;
}
pengzhou 说:
Aug 19, 2015 04:46:04 PM

那cena和lemon spj的模板呢laugh

Avatar_small
wyfcyx 说:
Aug 19, 2015 08:55:01 PM

@pengzhou: http://wyfcyx.is-programmer.com/posts/77528.html


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter