Submission #8219

# Submission time Handle Problem Language Result Execution time Memory
8219 2014-09-07T05:39:37 Z tncks0121 Cookie Clicker Alpha (GCJ14_cookie) C++
0 / 19
964 ms 1088 KB
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <memory.h> 
#include <math.h> 
#include <assert.h> 
#include <stack> 
#include <queue> 
#include <map> 
#include <set> 
#include <algorithm> 
#include <string> 
#include <functional> 
#include <vector> 
#include <deque> 
#include <utility> 
#include <bitset> 
#include <limits.h>  

using namespace std; 
typedef long long ll; 
typedef unsigned long long llu; 
typedef double lf;
typedef unsigned int uint;
typedef long double llf;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
#define memset0(x) memset(x, 0, sizeof (x));
int TC, TCC;

double C, X, F;

void init () {
}

void solve () {
	scanf("%lf%lf%lf", &C, &F, &X);

	lf res = X / 2;
	for(int farms = 0; farms < 2000; farms++) {
		if(farms * F + 2.0 > X) break;

		lf t = 0, r = X;
		for(int i = 0; i < farms; i++) t += C / (i * F + 2.0);
		t += r / (farms * F + 2.0);
		res = min(res, t);
	}

	printf("Case #%d: %.10lf\n", TCC, res);
}

int main() {
	
	scanf("%d", &TC);
	while(++TCC <= TC) {
		init();
		solve();
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 564 ms 1088 KB Output isn't correct - 18th numbers differ - expected: '2.7884981', found: '3.1693612', error = '0.1365836'
# Verdict Execution time Memory Grader output
1 Incorrect 964 ms 1088 KB Output isn't correct - 6th numbers differ - expected: '0.6518189', found: '1.5943528', error = '0.9425339'