QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#701085#7747. MemoryRegina#WA 0ms3776kbC++14728b2024-11-02 13:44:162024-11-02 13:44:17

Judging History

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

  • [2024-11-02 13:44:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3776kb
  • [2024-11-02 13:44:16]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+10;
int n,a[N];
double mood[N];
inline int read(){
    int r=0,f=1;char c=getchar();
    while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
    while(isdigit(c))r=(r<<1)+(r<<3)+(c^48),c=getchar();
    return r*f;
}
void put(int x){
    if(x<0){putchar('-');x=~x+1;}
    if(x>9)put(x/10);
    putchar(x%10+'0');
}
signed main(){
  //  freopen("cpp.in","r",stdin);
//    freopen("cpp.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++){
        a[i]=read();
        mood[i]=mood[i-1]*0.5+a[i];
        if(mood[i]<0)printf("-");
        else if(mood[i]==0)printf("0");
        else printf("+");
    }
    return 0;
}

详细

Test #1:

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

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

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

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'