QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#663032#7747. Memory1929902943WA 8ms4400kbC++14699b2024-10-21 12:15:392024-10-21 12:15:39

Judging History

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

  • [2024-10-21 12:15:39]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:4400kb
  • [2024-10-21 12:15:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double eps = 1e-300;
const ll mod = 1e9 + 7;
ll pow2[100100];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);
    pow2[0] = 1;
    int n;
    cin >> n;
    for(int i = 1; i <= n ; ++i)pow2[i] = 2*pow2[i - 1]%mod;
    ll res = 0;
    for(int i = 0 ; i < n ; ++i){
        ll a;
        cin >> a;
        res = (res + pow2[i]*a)%mod;
        if(res == 0)cout << 0;
        else if(res > 0)cout << "+";
        else if(res < 0)cout << "-";
    }
    return 0;
}
/*
10
2 -1 4 -7 4 -8 3 -6 4 -7
*/

詳細信息

Test #1:

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

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

input:

10
-1 36 18 18 18 18 18 18 18 -18

output:

-++++++++-

result:

ok single line: '-++++++++-'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3596kb

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:

ok single line: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-'

Test #4:

score: 0
Accepted
time: 8ms
memory: 4400kb

input:

100000
-1 696082628 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 ...

output:

-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...

result:

ok single line: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

10
-1 70 -35 -72 36 12 -6 42 -21 -84

output:

-+---+-+--

result:

ok single line: '-+---+-+--'

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3572kb

input:

1000
-1 -120742 60371 -567374 283687 -507718 253859 -579246 289623 21402 -10701 539474 -269737 -681332 340666 -746052 373026 -993382 496691 -333880 166940 -632724 316362 909690 -454845 86680 -43340 236688 -118344 -29102 14551 6252 -3126 -440612 220306 -878460 439230 649538 -324769 -651632 325816 882...

output:

---------+-+--+-+-+-+-++-+-+--++--+-++--++-+-+--++-+-+-+-+--++--+-++--+-++--++-+--+-++--+-++-+-+--++--++-+--+-++--+-+-++-+--++--+-++-+-+--+-+-++-+-+-+-+--+-+-++--+-++-+-+--+-+-++--+-+-++-+-+--+-+-++--++-+--++-+--++-+-+-+--++-+-+-+-+--+-+-+-++--+-++--+-++-+-+-+-+-+-+-+--++-+-+--+-+-++--++-+-+-+-+-+--...

result:

wrong answer 1st lines differ - expected: '---------+-+-----------+-+-+--...+---+-+-+-+-+-----+-+---------+', found: '---------+-+--+-+-+-+-++-+-+--...+--++-+-+-+-+--+-++-+--+-+-+-++'