QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#266395#7747. Memoryqkm66666#AC ✓5ms4188kbC++171.5kb2023-11-26 13:41:152023-11-26 13:41:15

Judging History

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

  • [2023-11-26 13:41:15]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:4188kb
  • [2023-11-26 13:41:15]
  • 提交

answer

#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cassert>
#include<cstdio>
#include<cctype>
#include<vector>
#include<bitset>
#include<random>
#include<ctime>
#include<queue>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long,long long>
#define FF fflush(stdout)
#define inf 0x3f3f3f3f
#define endl "\n"
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
//char buf[1<<20],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int read()
{
    int s=0,f=1;
    char x=getchar();
    while(!isdigit(x))f=(x=='-'?-1:1),x=getchar();
    while(isdigit(x))s=s*10+x-'0',x=getchar();
    return s*f;
}
const int p=1e9+7;
//ll ksm(int a,int b){ll ans=1,bs=a;while(b){if(b&1)ans=ans*bs%p;bs=bs*bs%p;b>>=1;}return ans;}
mt19937 rd(time(0));
#define reaD read
int a[100005];
int main()
{
    int n=reaD();
    double s=0;
    long long ss=0;
    int ok=0;
    for(int i=1;i<=n;i++)
    {
        a[i]=reaD();
        if(s<0)ss=ceil(s);
        else ss=floor(s);
        if(ss&1)
        {
            if(s<0)s++,ok=-1;
            else s--,ok=1;
        }
        s=s/2+a[i];
        if(ok==0&&s==0)putchar('0');
        else if(s>0||(s==0&&ok>0))putchar('+');
        else putchar('-');
    }
    //system("pause");
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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

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: 3ms
memory: 4128kb

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

input:

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

output:

-+---+-+--

result:

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

Test #6:

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

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:

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

Test #7:

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

input:

100000
-1 126247070 -63123535 -440273040 220136520 809537358 -404768679 -927404550 463702275 896759686 -448379843 155450002 -77725001 995415070 -497707535 -730811632 365405816 -223816910 111908455 255855870 -127927935 -78358522 39179261 190117110 -95058555 -61118274 30559137 243732804 -121866402 -48...

output:

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

result:

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

Test #8:

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

input:

10
0 2 -1 88 -44 14 -7 -32 16 32

output:

0+0+0+0-0+

result:

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

Test #9:

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

input:

1000
0 804678 -402339 501804 -250902 701336 -350668 341920 -170960 234558 -117279 138082 -69041 383094 -191547 613608 -306804 -173632 86816 105660 -52830 268340 -134170 -786944 393472 -702908 351454 236550 -118275 83428 -41714 280776 -140388 -743190 371595 -762656 381328 -873564 436782 565326 -28266...

output:

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+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+...

result:

ok single line: '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+'

Test #10:

score: 0
Accepted
time: 2ms
memory: 4128kb

input:

100000
0 281054714 -140527357 181299510 -90649755 -155852956 77926478 804466996 -402233498 100794828 -50397414 -498194394 249097197 674196350 -337098175 947822240 -473911120 649015454 -324507727 -445192880 222596440 517778906 -258889453 580158794 -290079397 -634780702 317390351 -689237014 344618507 ...

output:

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+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-...

result:

ok single line: '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-'

Test #11:

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

input:

10
1 96 -48 -50 25 38 -19 -16 8 64

output:

+++-+++-++

result:

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

Test #12:

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

input:

1000
1 -233282 116641 245142 -122571 -866732 433366 342040 -171020 -114326 57163 -723670 361835 559940 -279970 47632 -23816 -546562 273281 -677060 338530 189622 -94811 206166 -103083 -354146 177073 -503094 251547 671860 -335930 -810126 405063 -743936 371968 -799120 399560 579380 -289690 -829990 4149...

output:

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

result:

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

Test #13:

score: 0
Accepted
time: 4ms
memory: 3952kb

input:

100000
1 -836242278 418121139 779823668 -389911834 456274226 -228137113 -468926922 234463461 -674503678 337251839 -167236416 83618208 217124940 -108562470 83590374 -41795187 888634130 -444317065 -477073058 238536529 -539286006 269643003 593019232 -296509616 983037312 -491518656 -730801390 365400695 ...

output:

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

result:

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

Test #14:

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

input:

10
1 -92 -46 -46 -46 -46 -46 -46 -46 46

output:

+--------+

result:

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

Test #15:

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

input:

1000
1 -236388 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -1181...

output:

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

result:

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

Test #16:

score: 0
Accepted
time: 3ms
memory: 4044kb

input:

100000
1 -341428024 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -1707...

output:

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

result:

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

Test #17:

score: 0
Accepted
time: 5ms
memory: 4188kb

input:

100000
-480901673 -509307600 -562561206 -720747466 941874932 -338344843 -453928087 355126643 -42193930 344068464 -358448536 132560523 166795837 314061531 487526745 -156787355 611354631 116338982 -466559641 -310495789 -368174169 729138 -202574892 -453653662 -893218259 827601754 128423870 -106094115 7...

output:

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

result:

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

Test #18:

score: 0
Accepted
time: 5ms
memory: 3936kb

input:

100000
401801336 -153873233 -245401319 57736118 -371480661 -7386866 -962876999 -509105223 -97542547 312188284 -825578860 197298463 -215386150 -894478467 184851706 -973780424 -155743919 405442471 -448475678 509920273 119901780 330459500 -494037860 -200311269 791000901 -661046994 634125416 890073378 -...

output:

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

result:

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

Test #19:

score: 0
Accepted
time: 5ms
memory: 4128kb

input:

100000
-125561068 496528427 123636069 784342199 315163748 28603817 875018886 626662912 680133215 575275399 412323523 210158900 -892535431 -641075550 715201047 209226508 539100445 -138478419 -725359009 -374696372 902945022 417100071 -542411037 347998418 232130268 -392785534 -565205746 -460603926 -584...

output:

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

result:

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

Test #20:

score: 0
Accepted
time: 5ms
memory: 4060kb

input:

100000
757141941 851962794 440795956 -194084426 -460134759 116472002 366069975 -237568954 -785280815 838362513 -644741390 274896840 725282583 150384453 412526008 -902733855 -227998106 -144342224 -707275045 983776776 -557101528 503740642 -833874006 601340812 -378617867 -714458662 -59504201 483686065 ...

output:

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

result:

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

Extra Test:

score: 0
Extra Test Passed