QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637736 | #7747. Memory | zzuqy# | WA | 0ms | 3884kb | C++14 | 727b | 2024-10-13 13:56:34 | 2024-10-13 13:56:35 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define rep(a,b,c) for(int c=a;c<=b;++c)
using namespace std;
int n,a[1000009],sum;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
ll S=0,T=0;
rep(1,n,i)
{
S+=a[i];
if(S==0&&T==0)printf("0");
else
{
if(S>0||(S>=0&&T>=0))printf("+");
else printf("-");
}
if(S==0);
else
{
if(T)
{
T=S>0?1:-1;
}
else
{
if(S&1)T=S>0?1:-1;
}
S/=2;
}
}
return 0;
}
/*
100
2 -1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3768kb
input:
10 2 -1 4 -7 4 -8 3 -6 4 -7
output:
+0+-+---+-
result:
ok single line: '+0+-+---+-'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3884kb
input:
10 -1 36 18 18 18 18 18 18 18 -18
output:
-+++++++++
result:
wrong answer 1st lines differ - expected: '-++++++++-', found: '-+++++++++'