QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637648 | #7747. Memory | zzuqy# | WA | 13ms | 6068kb | C++14 | 572b | 2024-10-13 13:39:08 | 2024-10-13 13:39:13 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,a[1000009],sum;
int f[1000009];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
for(int i=1;i<=n;i++){
__int128 sum=0;
for(int j=i;j>=max(i-60,1);j--){
//cout<<(int)sum<<endl;
sum=sum*2+a[j];
}
//cout<<"sum:"<<(int)sum<<endl;
if(sum>0)f[i]=1,putchar('+');
if(sum<0)f[i]=-1,putchar('-');
if(sum==0){
int tmp=f[max(i-60,1)-1];
if(tmp>0)f[i]=1,putchar('+');
if(tmp<0)f[i]=-1,putchar('-');
if(tmp==0)f[i]=0,putchar('0');
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 5628kb
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: 5628kb
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: 5632kb
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: 13ms
memory: 6068kb
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: 1ms
memory: 5772kb
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: 5896kb
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: '---------+-+-----------+-+-+--...++--+-++++++++----+-+----+-+-++'