QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#595293#7747. MemoryYour-Sun#WA 0ms3708kbC++20991b2024-09-28 13:20:152024-09-28 13:20:15

Judging History

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

  • [2024-09-28 13:20:15]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-09-28 13:20:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
const ll mod=998244353;

void solve()
{
    ll n;
    double num=0;
    cin>>n;
    int check=0;
    bool flag=false;
    for(int i=1;i<=n;i++){
        int temp;
        cin>>temp;
        num+=temp;
        if(num>0){
            cout<<"+";
        }
        else if(fabs(num)<=1e-8){
            cout<<"0";
        }
        else if(num<0){
            cout<<"-";
        }
        // else{
        //     if(check==1)    
        //         cout<<"+";
        //     else
        //         cout<<"-";
        // }
        // if(num&1){
        //     if(num>0)   
        //         check=1;
        //     else    
        //         check=-1;
        //     flag=true;
        // }
        num/=2;
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int T;
    // cin>>T;
    T = 1;
    while(T--)
        solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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

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'