QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248628#6648. 总投票数kokomiisbestWA 10ms3460kbC++14723b2023-11-11 20:30:162023-11-11 20:30:16

Judging History

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

  • [2023-11-11 20:30:16]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3460kb
  • [2023-11-11 20:30:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
double p[105],l[105],r[105];
int main()
{
	int n,i,j,k,ll;
	cin>>n;
	for(i=1;i<=n;i++){
		string s;
		cin>>s;
		ll=s.size()-2;
		p[i]=0;
		for(j=2;j<s.size();j++) p[i]+=(s[j]-'0')*pow(10,-j+1);
	}
	sort(p+1,p+n+1);
	for(i=1;i<=n;i++)
	{
		l[i]=p[i]-5*pow(10,-ll-1);
		r[i]=p[i]+5*pow(10,-ll-1);
	//	printf("%.7f %.7f\n",l[i],r[i]);
	}
	for(i=1;i<=1e7;i++)
	{
		int flag=1;
		double xl=0,xr=0;
		for(j=1;j<=n;j++)
		{
			double t1=i*l[j],t2=i*r[j];
			if(ceil(t1)>floor(t2)) 
			{
				flag=0;break;
			}
			xl+=t1;xr+=t2;
		}
	//	cout<<xl<<" "<<xr<<endl;
		if(xl>i||xr<i) flag=0;
		if(flag){
			cout<<i;
			break;
		}
		
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 10ms
memory: 3460kb

input:

100
0.009862
0.010100
0.009996
0.010052
0.009983
0.009759
0.009846
0.010008
0.010085
0.009909
0.010107
0.010161
0.010011
0.009956
0.009948
0.009979
0.010020
0.009991
0.010060
0.010080
0.009949
0.009897
0.010135
0.010042
0.010003
0.009957
0.009934
0.009838
0.010195
0.010249
0.009908
0.009959
0.010060...

output:

925478

result:

wrong answer 1st numbers differ - expected: '942983', found: '925478'