QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#627076#7747. Memoryyixuanoct#WA 0ms3716kbC++14524b2024-10-10 14:39:422024-10-10 14:39:48

Judging History

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

  • [2024-10-10 14:39:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3716kb
  • [2024-10-10 14:39:42]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define int long long

const int N = 1e6 + 7;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;

signed main() {
    ios::sync_with_stdio(false), cin.tie(0);
    int n;
    cin >> n;
    double mood = 0;
    for (int i = 0;i < n;i++) {
        int x;
        cin >> x;
        mood = mood / 2 + x;
        if (mood >= -eps && mood <= eps) cout << '0';
        else if (mood > eps) cout << '+';
        else if (mood < -eps) cout << '-';
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

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: 3664kb

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: 3716kb

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'