QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#533147 | #4441. BIT Subway | xuzhihaodedie# | WA | 17ms | 6620kb | C++20 | 1.2kb | 2024-08-25 17:49:34 | 2024-08-25 17:49:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PII pair<int,int>
#define lson 2*p
#define rson 2*p+1
#define x first
#define y second
const int N=5e5+10;
const int mod=1e9+7;
int a[N];
void solve() {
int n;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
double ans=0,res=0;
for(int i=1;i<=n;i++) {
if(ans+a[i]>=100&&ans+a[i]<200) {
if(ans<=100) {
double remain=ans+a[i]-100;
ans=100+remain*0.8;
} else {
ans+=a[i]*0.8;
}
} else if(ans+a[i]>=200) {
if(ans<=200) {
double remain=ans+a[i]-200;
ans=200+remain*0.5;
} else {
ans+=a[i]*0.5;
}
} else {
ans+=a[i];
}
}
printf("%.3lf ",ans);
ans=0;
for(int i=1;i<=n;i++) {
if(ans>=100&&ans<200) {
ans+=a[i]*0.8;
} else if(ans>=200) {
ans+=a[i]*0.5;
} else {
ans+=a[i];
}
}
printf("%.3lf\n",ans);
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int T=1;
cin>>T;
while(T--) {
solve();
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 17ms
memory: 6620kb
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:
509.500 564.500 485.500 523.000 423.500 411.000 527.500 540.000 5087.600 5087.500 1023960.700 1023962.900 1022478.100 1022481.000 5014842.500 5014855.000 5011894.100 5011908.000 5018161.700 5018176.300
result:
wrong answer 1st lines differ - expected: '504.500 564.500', found: '509.500 564.500'