QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#73376#4392. BowcraftpoiWA 39ms5652kbC++1.5kb2023-01-24 19:10:122023-01-24 19:10:15

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-24 19:10:15]
  • 评测
  • 测评结果:WA
  • 用时:39ms
  • 内存:5652kb
  • [2023-01-24 19:10:12]
  • 提交

answer

#include "iostream"
#include "cstring"
#include "cstdio"
#include "algorithm"
#include "queue"
#include "vector"
#include "queue"
#include "stack"
#include "ctime"
#include "set"
#include "map"
#include "cmath"
using namespace std;
#define fi first
#define se second
#define vi vector<int>
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define mp make_pair
#define rep( i , a , b ) for( int i = (a) , i##end = b ; i <= i##end ; ++ i )
#define per( i , a , b ) for( int i = (a) , i##end = b ; i >= i##end ; -- i )
#define mem( a ) memset( a , 0 , sizeof (a) )
#define all( x ) x.begin() , x.end()
//#define int long long
typedef long long ll;
const int MAXN = 2e5 + 10;
int n , m;
int A , B;

double f[MAXN] , S[MAXN];

void solve() {
	cin >> n >> A >> B;
	vi pt;
	rep( i , 1 , B ) pt.pb( i );
//	S[1] = 2.5;
	rep( k , 1 , n ) {
		double l = 0 , r = 1e5;
		while( r - l > 1e-9 ) {
			double mid = ( l + r ) / 2;
			double a = 0 , b = 0;
			rep( i , 0 , A - 1 ) {
				double t;
				if( k > 1 ) t = min( ceil( mid * i * B * 1. / ( ( A - i ) * S[k - 1] ) ) , B * 1. );
				else t = B;
				a += t * i , b += ( A - i ) * t * ( t - 1. ) * S[k - 1] / ( B * 2 );
//				cout << t << ' ';
			}
//			puts("");
			b += B * A * A;
			if( b / a < mid ) r = mid;
			else l = mid;
		}
		f[k] = r;
		S[k] = S[k - 1] + f[k];
//	cout << f[k] << endl;
	}
	printf("%.6lf\n",S[n]);
}

signed main() {
//	freopen("in","r",stdin);
//	freopen("out","w",stdout);
	int T;cin >> T;while( T-- ) solve();
//	solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 39ms
memory: 5652kb

input:

10
996 99 66
904 99 86
609 85 57
729 63 57
617 78 72
751 81 89
952 93 94
791 58 66
726 94 75
1000 100 100

output:

77416.113021
75591.340897
35314.209377
48508.447732
40062.329949
58921.716034
85820.716857
59676.752602
51117.884869
93950.049352

result:

wrong answer 1st lines differ - expected: '77416.113', found: '77416.113021'