QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#662736#7747. Memory1929902943WA 0ms3844kbC++14585b2024-10-21 09:41:242024-10-21 09:41:24

Judging History

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

  • [2024-10-21 09:41:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3844kb
  • [2024-10-21 09:41:24]
  • 提交

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'