QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#662736 | #7747. Memory | 1929902943 | WA | 0ms | 3844kb | C++14 | 585b | 2024-10-21 09:41:24 | 2024-10-21 09:41:24 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double eps = 1e-18;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);cout.tie(nullptr);
int n;
cin >> n;
double res = 0;
for(int i = 0 ; i < n ; ++i){
double a;
cin >> a;
res = res/2 + a;
if(res > eps)cout << "+";
else if(fabs(res) <= eps)cout << "0";
else if(res < eps)cout << "-";
}
return 0;
}
/*
10
2 -1 4 -7 4 -8 3 -6 4 -7
*/
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3692kb
input:
10 2 -1 4 -7 4 -8 3 -6 4 -7
output:
+0+-+---+-
result:
ok single line: '+0+-+---+-'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
10 -1 36 18 18 18 18 18 18 18 -18
output:
-++++++++-
result:
ok single line: '-++++++++-'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3792kb
input:
1000 -1 193552 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 967...
output:
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
result:
wrong answer 1st lines differ - expected: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-', found: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++0'