QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#528346#7281. How to Avoid Disqualification in 75 Easy Stepsskittles1412#0 1ms3900kbC++178.1kb2024-08-23 13:03:382024-08-23 13:03:40

Judging History

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

  • [2024-08-23 13:03:40]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3900kb
  • [2024-08-23 13:03:38]
  • 提交

answer

// cf bits/extc++.h nonsense
#ifdef ONLINE_JUDGE
#define _EXT_CODECVT_SPECIALIZATIONS_H 1
#define _EXT_ENC_FILEBUF_H 1
#endif
#include "bits/extc++.h"

using namespace std;

template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
    cerr << t;
    ((cerr << " | " << u), ...);
    cerr << endl;
}

#ifdef DEBUG
#define dbg(...)                                              \
    cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: "; \
    dbgh(__VA_ARGS__)
#else
#define dbg(...)
#define cerr   \
    if (false) \
    cerr
#endif

using ll = long long;

#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))

inline void init_io() {
    cin.tie(nullptr);
    cin.exceptions(ios::failbit);
    ios_base::sync_with_stdio(false);
}

template <typename T>
ostream& operator<<(ostream& out, const vector<T>& arr) {
    out << "[";
    for (int i = 0; i < sz(arr); i++) {
        if (i) {
            out << ", ";
        }
        out << arr[i];
    }
    return out << "]";
}

template <typename T>
struct PSA {
    int n;
    vector<T> psum;

    template <typename U>
    PSA(const vector<U>& arr) : n(sz(arr)), psum(n + 1) {
        for (int i = 0; i < n; i++) {
            psum[i + 1] = psum[i] + arr[i];
        }
    }

    T query(int l, int r) const {
        return psum[r] - psum[l];
    }
};

template <typename T>
bool on(T mask, int bit) {
    return (mask >> bit) & 1;
}

string to_base_64(vector<bool> bits) {
    while (sz(bits) % 6) {
        bits.push_back(false);
    }

    string ans;
    for (int ql = 0; ql < sz(bits); ql += 6) {
        int cv = 0;
        for (int i = 0; i < 6; i++) {
            cv |= bits[ql + i] << i;
        }
        ans += char(' ' + cv);
    }

    return ans;
}

vector<bool> from_base_64(string s) {
    vector<bool> ans;

    for (auto& c : s) {
        int cv = c - ' ';
        for (int i = 0; i < 6; i++) {
            ans.push_back(on(cv, i));
        }
    }

    return ans;
}

vector<bool> to_bits(const vector<int>& arr) {
    vector<bool> ans;

    for (auto& a : arr) {
        for (int i = 0; i < 30; i++) {
            ans.push_back(on(a, i));
        }
    }

    return ans;
}

vector<int> from_bits(const vector<bool>& arr) {
    vector<int> ans;

    for (int ql = 0; ql < sz(arr); ql += 30) {
        int cx = 0;
        for (int i = 0; i < 30; i++) {
            cx |= arr[ql + i] << i;
        }
        ans.push_back(cx);
    }

    return ans;
}

void send(vector<int>);
vector<int> wait();

constexpr int n = 1000, m = 28;
vector<int> c_data;

void gen_data() {
    string cs = R"14121412( I!&",,@($!P) & #<@!"(.($!(1C  R -",P"(!@@1H"(40!)4 1E 8D$P @T 0)J 1 )8(!!#$R%@ <+!  ) G ( &$-(0!@H,(03@!"0E1 ,0#P  .$D"P 0%)B '"!@#%4 !@8$)" I#$!@%)(3H(! " '8!\!0 !@R(H (#%$"#!@!)(R@(!B(D(! !70$R" H!,!(*"P*&0 A($,"D@*8 !(&2$ %!X$D!"5 H(4"(E0 #"5 $D$P04($*"0(*"1@$,@1D$!X@ #(A$0B!(()@#80@2"1(0H"1D@$!@&B@"(T !*P)P!  H2@,5& ((51( (J! +  A 1+(2:$ (0* .'* (()"I( 0E &$04,* 0P(#$6 0!#1$*!! 2$%)2D("$2"0,$"A L( @1(+D )9 "(!,,,1%( %0$P! :00&,<"! 9"D@ &! -! 8H!*2((2$"$ I)@8P0"( %E((%*# "J ,$ 49@(@E H"<>   T$@ ,B4, !4B20 $4()( $K("6,(0 C,!0 [( ! 0!H$&80" '10@E )(@< J# A P!A!(830@ <0"""E H0$< &@$* 1*($*$+ H@1,  1H0)D P%$0H $' J0D(! *)%!@&@%P# $*8 A -A0"$*0"E@!:$"# 20 ". 4$E$)E  #!(G@  T0%(@X"D   C1,(%&!$*DP! ")L $@&&!(*!P # "+B"/"*   ,@8# $/$" PD .!(L# @B) *$00)*!)6 "1A$@"AD4 $4 Y ( )50"A$0T $H!!,0H$)" L((%H. #   2V$%$,@(Q2@ !$"*#($"!5" #%"#)) E H*$("C""@("22!$!,@)"!*) )!B@2(44@P "1V  "H9 (!X"(!@"@B&B"@!& N P$H(D *$(R, 3D! "4"8!$$ P2#%@%H  JBH !P#0!",,(",$2$!"%*, C@"0$&0 6$ @-8$$, @.HH 4!0L@4 '2 2  "(+% 0CT DU  (B4(("B-!( ("L@$!6("$$A4# "!(F!#%0D <D @"$12H 2$F $4!"8"B"&4 K@ @"(D5" :A  &@D"$&6" I #F H Q 0@*!FP (2& E 0,P% C !4$5@0A @(%I  %!3$":$B  @(F& 908$$,@ +DP<  P J!!40)D B @V 02",(&(#!" 8A '(, Q!+  &*)8$) @)$(* C <$#RA  A *"&2: 8 "B$3 AH""() 98  81")B@* #( %9$ #D2$0 A)&D1(0(@$()#15#  I"1 ()$0&(\ !@!)"  /80!%!& )B$,*0""$@$&#"8B$(2T@( )88 $D!D@($' ' ##$ ,4$!(*&$,#  4".((2"0#("I$!I !")@"1!&$&"!#!5 0)$)"D"%04A  '0@* M($", 5) 3(A( @ FQ 1P P"@(4B!B X"!)*40  #@***1!2 0A#$$10,$!50*! ,4 9  (8R$I@#( ,A3  !""J$!(H4$!A(!,J ",$:* $"08$0* *,8"!$!&&#@1P 2(!2(%"#$" JD #1@ H%F4$ $B $A%H081  P*< 8%1@ )!H #@,3 "Z A0 .@!"(!(@'( )C"!,$!!%B#(($$Y(( )@(D"@ ^ (("03$4(@2(!*$@,$2H($(1D($2 #D"  5= @64@ Z" 0$ D%(& Q$6 )4$""$0%8(2H1@ L0@D %F@$ $U@" BB + '"&( T*!$ ,""A(#"(1(R ! +( C(#T$"($XD($ "B'$ $(<0(0B!1$#4@@"4($!&!D P*U & ( QP8 (@#3  4<0$H"A2 @$AC E$@) @&!&!(AI" B 08%C$$($(3"B 11@* (P20$H$""&!0,D",! "+ H(Q(0 BA&"("'(1% $*!C %(()J@  C!A" "<,$C !: P6 2 H H< $F@($*$ $'P @D)\ $, @0@H*Q1 "$ D2#$0&4& (*,% !%6" $& X! P A-  :+(8@K  )! ,," Z($@"AH(Y(($ %! &%0+$* 2 @." H$X(@! #'(@BD(D #0&$(@1&)!D0$ $\@!0&("* *"6"* !!.HB0!$0'2! C (E 4!&($* $L!00') P$24 2B, !)$"E BL"!  00Z!-$A !I & #$ @8.BB %!!%P1 #H@1 #",& TP1  0 +4!HI! "! R%!0(@A#0BP* "4 <$ "AP*)@%4 (18"!A0&# " HQ"!!C"$"L(@! 4D2!,*@$($1 R": @H"'8  #M$ @"0H#* 5!!(!Z!(" 9!R  F H$!3!"((%  G(D") %$D@%"00D,(  T+$8R  &!M#  8@!. '0!!$"7@! 1( 3!  $'.!1&1 (("I$90&$ $$ :&8,02 +L $  (T",2" T(0@A1!!0!2,@)$!% , G!  ZB" -4$$2$02$)DB $A5(! !"P&"B9 @"4 AX $@B4!& D!)",@4( 8(N  8&%$00"0+ @,/ $@N $0)00)*#( ,!!AD(P !6(!+ $&, D,"&+ "$8!8($2!!@% M *!"4) #DB$(( &(D,& &R @: *(((3$(:84  20$P$"%00#"P,@$"80 + $!2+""@.!&"Q$ C!D( @)H, (HB0"D"02$7 0 %D(( .@A"(,*!84 0 %6$!228 %8#( !<!D D(A"$L%0"  L, )!%P* $2 B*% R ,0 6!,(<"@"$(@&&A%%@ !'8(  !+(* 5H$$!@8' A Q($2$HP 0"0P)@@B*!F% @$$%%D @1!4"DP@ #BQ8  ; (0" <P@((A,8 @3H "F$@0!PB2@ 0"P8"02!C  (/@( &L"(@P% ,(0 ;!$2T (0$!B,2!*@" Q@A(#,*" ,8)"  )#1!,@(&! 05$#S"4  BD8( :P"@ ,H$($$!X(!%*)@ - $1" %"X!8#"(!(!T%  0)<(/! 1 A (X!)"&2 ! IA$0 :&! "9,!J ;  "<1! D8 $%!)$$), F"!0I R 0!,@,B)!# 0!R@!8!@Q @,*@$" 6D!  ";*&!- !"P0"%,$8@$$V#  (9@1 0 "] ! 8('$11 & =2 !! #*#0&D &( 2!')!-! 8 (*))"0%$$,0&( *2P!!"(T!@"$2* W $"$P0D"49 !$*&6  $$C% J"!,  @%B)B"4 ,02!8!0,% %PC "!$DAB @0-""48H "( (6#  "L'# $!+1@( +Q!$(! 08*&!480""$:!(AAH0 $0(%#@0!J$5 (4"@$I0(<@ 5 BPD" 6@(H 8&(1 ""%#(8 5@"!"0H)&D+  (E I )"@#!"$2&"(! =(.* 0!!:(!!,3 0(=B " $)" -!0)%(8)"&  8:0(EA !!!H04"!:$$$5@ :  "7A V" "!"@(:(% 0$., @J!'@<  "P02" E2@"B8 "&8 P)!(0D4(0&B$!3"# !H$$2$P$ 0'L2$ !' !0*X (@,$*C0 H*" %*& B(# P$,"1#$! K$0!@C"0" (1Q"8 44!%.0 !1@"F  "PA%2,"@(),(0($HP %%!D&  +: $8*B (+1 (!A040!"EB "@("Z 4# B(E 4* B( P) &@(- %$,%E@("(' R@ *"-0  D6((%H"A 0$%#!F  #*"(TP FBB  $!.& P0)!$T&(@ 2"J" ,!8@("#1"!"C"@$4)D "" H@- HZ!  H-!"+@ !% \!((1$08!@ P0-@& <"H( T"@!S ")B"!"(B!@,06 H"(0(F($ @#- 1"),2H$ ,B%B" 0043  @AL$@* A*(!0F$N( @$4$*, 2C !(@0((- + I!4PB ("D$0%!0 =$((*8!X$@(!!"B0%D00@) 3!)$(V00 A @1#0!Q2 F( . $P 1& D1@% "D9!, !1) ,8)$* H%( $*8,1 )0%4!)# !9$"(!D "-()) , $H-!%0Q0 *1!@(< !0&G(8  "B4@"DA)$ $CH!  E@!%0(1)(A"B%  ,%: @!1$,$!' *D"%!$@2*!"(Q)! H@@P!@(@9$4# 4!(P$C !!"B*@A!0%$&< " %R0(( PX("(2: $ %@'  !\)"!0I$4AP$ 0B (.#" B#0HH"!4'$ !H P!*)@0"&&P( )@11A %#0D D(0(#M# ( !- 2"7 "% (,)& (@&%!0"*2$($"H,H0J"  (*!+!&!@#C)0 $ FJ (%1@@$$ ),& 0@'%$ J$**@$9 21 #!I6 $ (B :""2# *  ,Q%98 @(T0$@""3$) 08#0$@(,&$&H@@"$&#"(2!D"(@0., ,4& (! D$'$-1! "90((! K2 Q %0"63"  (HP )40 B%8!($)2 .$(P@T0 L  $+"! 2.," *,J$ B!H@%!!V0 (($ 16!!B%"$(T!$!""B0#8 )I $A*@!8( *&"2(A! J# &@34" ! #A)A0P, @#"&$( ."*"!4P(@)(0#!4* )B0B!( 0CJ 0@X@$3$$0(#$Q !0E(((X!, "&$1("" 3%$("4*!$1B!!@<8"  (Q*"%%*0 #$#@$1 JH A20 ,,@H((8* D$0(M$ # !'!@<B( #- !$ 1*P$!2!L  I.@ #!!H"$0: %%!A!"(8$@%($E$$P4$!"0:( #(!22( >$(!&,$H @$D&"!# 9"!$$1,&!A4  '(R !.%! AJ@ $$@ K$B!$%(P@8$"P$0+ "@T!!"(8$&$C$ &@+ 0,EL  "@$Y$  6!#!!S0 !B(5$ "P&!"@9+   \ 3 @"8")A@D ) %8",4 LA $B 0- Q!X BHP$ $'I  (# H&#  X,5"A $ 2' %1 .("1 <B 0,($) 0&X"25$$ $(!8%(.1( J$% "$@90" $'4(!K!( &D %(B((5 #P . 0!01&4$50 &)(A "&)) $&&0$02P"$6($$!.R ! F 2(()14121412";
    c_data = from_bits(from_base_64(cs));
    dbg(sz(c_data), c_data);
}

pair<int, int> scout(int r, int h) {
    gen_data();
    for (int i = 0; i < m; i++) {
        vector<int> cv;

        for (int j = 0; j < n; j++) {
            if (on(c_data[j], i)) {
                cv.push_back(j + 1);
            }
        }

        send(cv);
    }

    long cans = 0;
    {
        auto res = wait();
        for (int i = 0; i < sz(res); i++) {
            cans |= res[i] << i;
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if ((c_data[i] | c_data[j]) == cans) {
                return {i + 1, j + 1};
            }
        }
    }

    assert(false);
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3592kb

input:



output:


result:

wrong answer Not correct

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 1ms
memory: 3640kb

input:

\x14

output:


result:

wrong answer Not correct

Subtask #3:

score: 0
Wrong Answer

Test #66:

score: 0
Wrong Answer
time: 1ms
memory: 3900kb

input:

\x1e

output:


result:

wrong answer Not correct

Subtask #4:

score: 0
Wrong Answer

Test #120:

score: 0
Wrong Answer
time: 1ms
memory: 3644kb

input:

K

output:


result:

wrong answer Not correct