QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#197200#4441. BIT Subwayyiyiyi#AC ✓24ms3912kbC++14643b2023-10-02 13:14:402023-10-02 13:14:41

Judging History

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

  • [2023-10-02 13:14:41]
  • 评测
  • 测评结果:AC
  • 用时:24ms
  • 内存:3912kb
  • [2023-10-02 13:14:40]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(int i=(s);i>=(t);i--)
using namespace std;
int ci(){ int x; scanf("%lld",&x); return x;}

enum{N=5023};

signed main(){
	int T = ci();
	while( T-- ){
		int n = ci();
		double sum = 0;
		double ans = 0;
		rep(i,1,n){
			int x = ci();
			double f = ans<100 ? 1 : ( ans<200 ? 0.8:0.5);
			sum += x;
			ans += f*x;
		}
		double ans1 = sum<100 ? sum : ( sum<100+100/0.8 ? 100+(sum-100)*0.8 : 100+100+(sum - 100 - 100/0.8)*0.5);
		printf("%.3lf %.3lf\n", ans1, ans);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 24ms
memory: 3912kb

input:

10
10
20 50 105 200 11 31 88 177 30 122
12
75 200 65 200 200 1 2 3 4 5 6 10
10
95 5 125 200 10 20 70 60 55 7
10
99 126 70 10 32 22 200 199 20 77
10000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

504.500 564.500
473.000 523.000
411.000 411.000
515.000 540.000
5087.500 5087.500
1023956.500 1023962.900
1022476.500 1022481.000
5014830.000 5014855.000
5011888.500 5011908.000
5018160.500 5018176.300

result:

ok 10 lines