Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

多简洁的代码- -!想到数据都过了,可是为嘛还wa

Posted by lufengguang at 2014-08-26 17:04:29 on Problem 1064
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    int a,b,c;
    int arr[10005],sum=0;
    float f;
    cin>>a>>b;
    for(int i=0;i<a;i++)
    {cin>>f;
    arr[i]=(f+0.005)*100;
    }
   while(++sum){
        c=0;
        for(int i=0;i<a;i++)
        c+=arr[i]/sum;
        if(c<b) break;
    }
    f=(sum-1)/100.0;
   printf("%.2lf",f);
   return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator