QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#283047 | #6648. 总投票数 | one_god_and_two_dogs# | WA | 5ms | 3908kb | C++14 | 1.2kb | 2023-12-13 18:40:19 | 2023-12-13 18:40:20 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int Mx=1e6;
const double eps=1e-8;
int n,m;
double p[105];
double l[105],r[105];
char S[10];
int len;
double mi=1.0;
int main() {
scanf("%d",&n);
for(int i=1; i<=n; ++i) {
scanf("%s",&S);
len=strlen(S);
if(S[0]=='1')p[i]=1;
for(int j=2; j<len; ++j)
p[i]=p[i]*10+(S[j]^48);
}
for(int i=1; i<=len-2; ++i)mi=mi*0.1;
for(int i=1; i<=n; ++i) {
p[i]*=mi;
l[i]=p[i]-mi/2,r[i]=p[i]+mi/2;
}
while(true) {
++m;
bool f=true;
for(int j=1; j<=n; ++j) {
double x=l[j]*m,y=r[j]*m;
int xx=int(x),yy=int(y);
if((y-yy)<=eps&&(x-xx)>eps&&yy==xx+1)f=false;
if(xx==yy&&(x-xx)>eps)f=false;
//if(m==7766)cout<<xx<<" "<<yy<<" "<<x<<" "<<y<<endl;
if(!f)break;
}
if(f)break;
}printf("%d",m);
return 0;
}
/*
13
0.00155
0.03876
0.01584
0.05189
0.08099
0.06825
0.15658
0.10404
0.02640
0.14332
0.12941
0.15529
0.02768
7
0.041096
0.109589
0.109589
0.164384
0.301370
0.068493
0.205479
*/
詳細信息
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 3908kb
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'