QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#726444#8332. Two in Onebeamishboys#AC ✓38ms4360kbC++207.6kb2024-11-09 00:42:312024-11-09 00:42:32

Judging History

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

  • [2024-11-09 00:42:32]
  • 评测
  • 测评结果:AC
  • 用时:38ms
  • 内存:4360kb
  • [2024-11-09 00:42:31]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

/* Macros {{{ */
/*  A lot of this is from some of Benq's submissions
    [https://codeforces.com/profile/Benq]
    Ugly af to the eyes, but with vim fold its barable
    Hopefully c++20 concepts can make all this stuff must cleaner */

/* Basics {{{ */
using ll = long long;
using ld = long double;
using str = string;

using pi = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
#define mp make_pair
#define fi first
#define se second

#define arr array
#define ve vector
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;

using vpi = vector<pi>;
using vpll = vector<pll>;
using vpld = vector<pld>;

using vvi = vector<vi>;
using vvll = vector<vll>;
using vvld = vector<vld>;

using vvpi = vector<vpi>;
using vvpll = vector<vpll>;
using vvpld = vector<vpld>;

#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz size()
#define rsz(a) resize(a)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

#define For(i, a, b) for (int i = a; i < b; ++i)
#define Rof(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define rep(a) For(_, 0, a)
#define each(a, x) for (auto &a : x)
#define reach(a, x) for (auto a = x.rbegin(); a != x.rend(); ++a)

template <typename T, typename U>
inline void cmin(T &x, U y) {
    if (y < x) x = y;
}
template <typename T, typename U>
inline void cmax(T &x, U y) {
    if (x < y) x = y;
}
/*}}}*/

/* IO {{{ */

/* Template Macros {{{ */
#define tcT template <class T
#define tcTU tcT, class U
#define tcTUU tcT, class... U
/*}}}*/

inline namespace Helpers { /*{{{*/
tcT, class = void > struct is_iterable : false_type {};
tcT > struct is_iterable<
          T, void_t<decltype(begin(declval<T>())), decltype(end(declval<T>()))>>
    : true_type {};
tcT > constexpr bool is_iterable_v = is_iterable<T>::value;

tcT, class = void > struct is_readable : false_type {};
tcT > struct is_readable<T, typename std::enable_if_t<is_same_v<
                                decltype(cin >> declval<T &>()), istream &>>>
    : true_type {};
tcT > constexpr bool is_readable_v = is_readable<T>::value;

tcT, class = void > struct is_printable : false_type {};
tcT > struct is_printable<T, typename std::enable_if_t<is_same_v<
                                 decltype(cout << declval<T>()), ostream &>>>
    : true_type {};
tcT > constexpr bool is_printable_v = is_printable<T>::value;
} /* namespace Helpers */
/*}}}*/

inline namespace Input { /*{{{*/
tcT > constexpr bool needs_input_v = !is_readable_v<T> && is_iterable_v<T>;
tcTUU > void re(T &t, U &...u);
tcTU > void re(pair<T, U> &p); /* pairs */

/* re: read{{{ */
tcT > typename enable_if<is_readable_v<T>, void>::type re(T &x) {
    cin >> x;
} /* default */
tcT > typename enable_if<needs_input_v<T>, void>::type re(
          T &i);                                   // vectors, arrays, etc...
tcTU > void re(pair<T, U> &p) { re(p.fi, p.se); }  // pairs
tcT > typename enable_if<needs_input_v<T>, void>::type re(T &i) {
    each(x, i) re(x);
}
tcTUU > void re(T &t, U &...u) {
    re(t);
    re(u...);
} /* read multiple}}} */

/* rv: resize and read vectors{{{ */
void rv(size_t) {}
tcTUU > void rv(size_t N, ve<T> &t, U &...u);
template <class... U>
void rv(size_t, size_t N2, U &...u);
tcTUU > void rv(size_t N, ve<T> &t, U &...u) {
    t.rsz(N);
    re(t);
    rv(N, u...);
}
template <class... U>
void rv(size_t, size_t N2, U &...u) {
    rv(N2, u...);
} /*}}}*/

/* dumb shortcuts to read in ints{{{ */
void decrement() {} /* subtract one from each */
tcTUU > void decrement(T &t, U &...u) {
    --t;
    decrement(u...);
}
#define ints(...)    \
    int __VA_ARGS__; \
    re(__VA_ARGS__);
#define int1(...)      \
    ints(__VA_ARGS__); \
    decrement(__VA_ARGS__); /*}}}*/
} /* namespace Input */
/*}}}*/

inline namespace ToString { /*{{{*/
tcT > constexpr bool needs_output_v = !is_printable_v<T> && is_iterable_v<T>;

/* ts: string representation to print */
tcT > typename enable_if<is_printable_v<T>, str>::type ts(T v) {
    stringstream ss;
    ss << fixed << setprecision(15) << v;
    return ss.str();
} /* default */
tcT > str bit_vec(T t) { /* bit vector to string */
    str res = "{";
    For(i, 0, t.sz) res += ts(t[i]);
    res += "}";
    return res;
}
str ts(ve<bool> v) { return bit_vec(v); }
template <size_t SZ>
str ts(bitset<SZ> b) {
    return bit_vec(b);
} /* bit vector */
tcTU > str ts(pair<T, U> p); /* pairs */
tcT > typename enable_if<needs_output_v<T>, str>::type ts(
          T v); /* vectors, arrays */
tcTU > str ts(pair<T, U> p) { return "(" + ts(p.fi) + ", " + ts(p.se) + ")"; }
tcT > typename enable_if<is_iterable_v<T>, str>::type ts_sep(T v, str sep) {
    /* convert container to string w/ separator sep */
    bool fst = 1;
    str res = "";
    for (const auto &x : v) {
        if (!fst) res += sep;
        fst = 0;
        res += ts(x);
    }
    return res;
}
tcT > typename enable_if<needs_output_v<T>, str>::type ts(T v) {
    return "{" + ts_sep(v, ", ") + "}";
}

/* for nested DS */
template <int, class T>
typename enable_if<!needs_output_v<T>, ve<str>>::type ts_lev(const T &v) {
    return {ts(v)};
}
template <int lev, class T>
typename enable_if<needs_output_v<T>, ve<str>>::type ts_lev(const T &v) {
    if (lev == 0 || !v.sz) return {ts(v)};
    ve<str> res;
    for (const auto &t : v) {
        if (res.sz) res.back() += ",";
        ve<str> tmp = ts_lev<lev - 1>(t);
        res.insert(end(res), all(tmp));
    }
    For(i, 0, res.sz) {
        str bef = " ";
        if (i == 0) bef = "{";
        res[i] = bef + res[i];
    }
    res.back() += "}";
    return res;
}
} /* namespace ToString */
/*}}}*/

inline namespace Output { /*{{{*/
template <class T>
void pr_sep(ostream &os, str, const T &t) {
    os << ts(t);
}
template <class T, class... U>
void pr_sep(ostream &os, str sep, const T &t, const U &...u) {
    pr_sep(os, sep, t);
    os << sep;
    pr_sep(os, sep, u...);
}
/* print w/ no spaces */
template <class... T>
void pr(const T &...t) {
    pr_sep(cout, "", t...);
}
/* print w/ spaces, end with newline */
void ps() { cout << "\n"; }
template <class... T>
void ps(const T &...t) {
    pr_sep(cout, " ", t...);
    ps();
}
/* debug to cerr */
template <class... T>
void dbg_out(const T &...t) {
    pr_sep(cerr, " | ", t...);
    cerr << endl;
}
void loc_info(int line, str names) {
    cerr << "Line(" << line << ") -> [" << names << "]: ";
}
template <int lev, class T>
void dbgl_out(const T &t) {
    cerr << "\n\n" << ts_sep(ts_lev<lev>(t), "\n") << "\n" << endl;
}
} /* namespace Output */
/*}}}}}}}}}*/

int n;
vi c;

void solve() {
    re(n), rv(n, c);

    vi feq(n+1, 0);
    for(auto v : c) ++feq[v];

    sort(all(feq), greater{});

    int f1 = feq[0];
    int res = f1;

    for(int i=1; i<n; ++i) {
        int f2 = feq[i];

        int faf = max(f1 & f2, 1); // so faf-1 >= 0
        while(faf != (faf&-faf)) faf -= (faf&-faf);
        cmax(res, f1 | f2 | (faf-1));
    }

    ps(res);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    /* cout << fixed << setprecision(6); */
    int t = 1;
    cin >> t;
    for (int i = 0; i < t; i++) solve();

    return 0;
    // you should actually read the stuff at the bottom
}

/* stuff you should look for
 * int overflow, array bounds
 * special cases (n=1?)
 * do smth instead of nothing and stay organized
 * WRITE STUFF DOWN
 * DON'T GET STUCK ON ONE APPROACH
 */

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3844kb

input:

1
7
1 2 3 4 3 2 1

output:

3

result:

ok 1 number(s): "3"

Test #2:

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

input:

1
9
1 1 1 1 1 2 2 2 2

output:

7

result:

ok 1 number(s): "7"

Test #3:

score: 0
Accepted
time: 19ms
memory: 3576kb

input:

50
10000
72 65 90 94 67 93 41 43 54 83 31 34 38 37 44 42 92 63 66 79 90 45 41 40 19 54 34 90 13 74 40 77 41 57 74 86 91 79 34 39 21 88 90 57 23 31 8 15 80 27 45 38 53 96 51 82 70 71 19 75 62 95 31 67 99 97 94 29 90 7 95 82 61 98 62 77 43 65 66 30 41 69 38 79 51 9 63 77 13 30 72 70 67 93 92 45 74 50 ...

output:

255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255

result:

ok 50 numbers

Test #4:

score: 0
Accepted
time: 38ms
memory: 3548kb

input:

79114
7
1 2 4 3 2 3 7
7
1 2 4 7 4 1 5
6
4 2 2 4 2 1
7
1 2 1 4 7 3 2
7
1 2 4 7 1 1 3
7
1 2 6 1 5 2 5
6
5 2 6 1 2 5
7
1 1 7 6 6 5 2
7
1 2 5 6 6 7 7
7
1 1 2 7 2 3 6
7
1 1 1 4 6 2 2
7
1 1 5 7 3 5 2
7
1 1 7 6 2 2 5
6
4 3 4 6 3 1
6
4 4 3 2 3 1
7
1 1 2 3 7 6 2
6
1 2 5 6 3 4
7
1 1 1 1 4 7 6
6
2 6 6 2 5 3
6
...

output:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
1
5
3
3
3
3
3
3
3
3
3
3
3
5
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
6
3
3
3
3
5
3
3
3
5
3
3
3
3
3
3
3
3
3
3
5
3
3
3
3
3
3
3
3
3
3
3
5
3
3
3
1
3
3
3
3
3
3
5
3
3
3
3
3
3
3
3
3
3
...

result:

ok 79114 numbers

Test #5:

score: 0
Accepted
time: 31ms
memory: 3772kb

input:

50000
10
6 3 8 5 4 6 3 5 3 9
10
10 4 3 10 4 5 2 7 8 10
10
10 6 2 2 4 9 7 3 3 4
10
1 2 9 7 5 2 1 2 10 1
10
2 8 2 3 7 8 3 5 10 5
10
5 6 10 2 7 3 5 10 5 4
10
3 4 4 2 2 1 1 8 5 10
10
3 3 3 8 5 7 3 6 7 9
10
10 6 5 3 2 8 10 9 9 4
10
5 8 6 2 10 5 8 8 10 7
10
5 8 2 10 2 2 9 5 4 2
10
7 6 4 7 5 9 2 2 1 7
10
7...

output:

3
3
3
3
3
3
3
6
3
3
6
3
3
3
6
3
3
3
3
6
3
3
3
3
3
3
3
3
6
3
6
3
3
3
6
3
6
3
7
3
3
6
3
3
3
6
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
6
3
3
3
3
3
3
3
3
3
5
3
3
7
3
3
3
3
3
3
6
3
3
3
6
3
3
3
7
3
6
3
3
3
3
3
3
3
6
3
3
5
3
3
6
7
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
6
3
7
3
3
3
3
3
3
6
3
...

result:

ok 50000 numbers

Test #6:

score: 0
Accepted
time: 27ms
memory: 3504kb

input:

50000
10
2 1 2 2 2 2 1 2 1 3
10
3 2 1 3 2 2 1 2 2 3
10
3 2 1 1 2 3 2 1 1 2
10
1 1 3 2 2 1 1 1 3 1
10
1 2 1 1 2 2 1 2 3 2
10
2 2 3 1 2 1 2 3 2 2
10
1 2 2 1 1 1 1 2 2 3
10
1 1 1 2 2 2 1 2 2 3
10
3 2 2 1 1 2 3 3 3 2
10
2 2 2 1 3 2 2 2 3 2
10
2 2 1 3 1 1 3 2 2 1
10
2 2 2 2 2 3 1 1 1 2
10
2 3 2 1 1 2 2 1...

output:

7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
9
7
7
7
7
7
7
7
7
7
7
9
7
7
7
7
7
9
7
7
7
7
7
7
9
9
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
9
7
7
7
7
7
9
7
10
7
7
7
7
7
7
10
7
7
7
7
7
7
7
7
7
7
7
7
7
10
7
7
7
7
7
7
7
7
7
7
7
7...

result:

ok 50000 numbers

Test #7:

score: 0
Accepted
time: 24ms
memory: 3544kb

input:

5000
100
35 13 56 51 37 39 100 35 21 36 54 19 99 74 38 99 90 69 29 23 38 27 40 94 92 93 93 45 94 22 65 65 43 62 47 53 11 77 87 15 77 72 3 38 25 19 4 82 48 69 15 13 8 76 48 8 19 86 25 26 34 70 38 42 87 81 31 92 30 24 80 69 8 74 48 30 57 47 65 42 35 47 42 85 18 94 97 13 8 24 100 31 51 72 69 95 74 90 9...

output:

7
7
3
7
7
7
7
7
7
7
7
7
7
3
7
7
7
7
7
7
7
7
3
7
7
3
7
7
7
7
3
7
7
7
7
7
7
3
7
7
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
3
7
7
7
3
7
7
7
7
7
3
7
7
7
3
7
7
7
3
7
7
7
7
3
7
7
3
7
7
7
7
7
7
7
7
7
7
3
7
7
7
7
7
7
7
7
7
7
3
7
7
3
3
7
7
7
7
7
7
7
7
7
7
7
7
3
3
7
7
7
7
3
7
7
7
7
7
7
7
7
7
7
7
3
7
...

result:

ok 5000 numbers

Test #8:

score: 0
Accepted
time: 17ms
memory: 3548kb

input:

5000
100
5 3 7 7 6 6 10 5 4 6 7 4 9 8 6 9 9 8 5 4 6 5 6 9 9 9 9 6 9 4 8 8 6 7 6 7 3 8 9 3 8 8 1 6 5 4 2 9 6 8 3 3 2 8 6 2 4 9 5 5 5 8 6 6 9 9 5 9 5 4 8 8 2 8 6 5 7 6 8 6 5 6 6 9 4 9 9 3 2 4 10 5 7 8 8 9 8 9 9 8
100
6 6 4 2 6 5 9 9 6 7 9 7 6 6 3 3 4 9 7 7 9 6 9 3 6 3 10 6 8 9 8 9 5 6 3 3 5 9 8 8 8 1 ...

output:

31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
...

result:

ok 5000 numbers

Test #9:

score: 0
Accepted
time: 26ms
memory: 3840kb

input:

500
1000
826 799 36 103 143 218 173 682 364 907 788 338 489 308 749 437 185 166 973 723 463 220 892 883 126 274 442 324 227 772 349 202 740 43 361 521 690 113 160 281 364 507 913 552 766 661 82 931 590 896 439 701 330 538 939 710 841 660 620 727 309 506 113 55 230 459 734 675 977 737 922 642 860 894...

output:

7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
...

result:

ok 500 numbers

Test #10:

score: 0
Accepted
time: 18ms
memory: 3568kb

input:

500
1000
28 28 6 10 11 14 13 26 19 30 28 18 22 17 27 20 13 12 31 26 21 14 29 29 11 16 21 18 15 27 18 14 27 6 19 22 26 10 12 16 19 22 30 23 27 25 9 30 24 29 20 26 18 23 30 26 29 25 24 26 17 22 10 7 15 21 27 25 31 27 30 25 29 29 25 24 9 10 16 24 29 23 19 16 28 21 28 12 31 10 20 18 11 21 14 11 14 12 19...

output:

63
63
127
127
63
127
125
63
127
127
127
126
127
63
63
63
127
127
127
127
63
127
126
127
127
127
127
127
127
63
127
127
127
63
127
127
123
127
63
127
63
119
127
63
125
127
127
63
127
127
123
126
127
127
63
127
125
127
127
119
127
127
119
127
127
63
63
127
63
63
127
127
127
63
122
63
127
127
127
63
63...

result:

ok 500 numbers

Test #11:

score: 0
Accepted
time: 27ms
memory: 3908kb

input:

50
10000
5231 4283 8159 8842 4592 8761 1749 1922 2947 6985 988 1176 1520 1420 2002 1812 8626 4019 4403 6360 8219 2027 1745 1619 395 2982 1182 8185 179 5604 1659 5959 1682 3355 5489 7484 8447 6328 1184 1555 477 7889 8272 3343 544 975 80 226 6518 729 2044 1450 2904 9281 2622 6742 4921 5143 372 5695 39...

output:

7
7
7
7
7
7
7
7
7
7
7
7
15
7
15
7
7
7
7
7
7
7
7
7
7
7
15
7
15
7
7
7
7
7
7
15
7
7
7
7
15
7
15
7
7
7
7
7
7
15

result:

ok 50 numbers

Test #12:

score: 0
Accepted
time: 30ms
memory: 4020kb

input:

5
100000
91675 46565 38979 3941 53894 98418 84900 84804 53487 7391 37558 42152 21892 48134 40091 35126 70005 1153 61201 47390 57436 20581 76773 48574 35571 42660 42943 41736 20593 53925 22043 8372 31184 39982 17663 22303 48407 27491 22257 13831 393 13278 29991 80618 89887 63441 66588 3667 95209 5383...

output:

7
15
7
15
15

result:

ok 5 number(s): "7 15 7 15 15"

Test #13:

score: 0
Accepted
time: 22ms
memory: 3992kb

input:

5
100000
302 215 197 62 232 313 291 291 231 85 193 205 147 219 200 187 264 33 247 217 239 143 277 220 188 206 207 204 143 232 148 91 176 199 132 149 220 165 149 117 19 115 173 283 299 251 258 60 308 232 146 306 197 294 154 246 245 305 134 237 129 217 233 192 65 210 290 153 309 212 229 155 157 33 260...

output:

1023
1023
1023
1023
1023

result:

ok 5 number(s): "1023 1023 1023 1023 1023"

Test #14:

score: 0
Accepted
time: 19ms
memory: 4360kb

input:

5
99999
5 5 5 5 5 5 4 5 4 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 4 5 5 5 5 4 5 5 3 5 5 5 5 5 5 5 5 3 5 5 4 5 5 5 3 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 4 5 5 5 5 5 5 5 5 4 4 5 5 5 5 5 5 5 5 5 ...

output:

98303
98303
98303
98303
98303

result:

ok 5 number(s): "98303 98303 98303 98303 98303"

Test #15:

score: 0
Accepted
time: 27ms
memory: 4028kb

input:

5
99999
63915 63915 63915 63915 38059 63915 63915 63915 25192 63915 1024 63915 63915 63915 63915 63915 63915 63915 63915 63896 63915 63915 14963 63915 63915 63915 52208 84889 63915 63915 63915 63915 63915 40674 63915 62258 63915 63915 63915 16744 63915 63915 63915 96429 91077 63915 63915 63915 43576...

output:

65535
83967
65535
98303
57343

result:

ok 5 number(s): "65535 83967 65535 98303 57343"

Test #16:

score: 0
Accepted
time: 23ms
memory: 3628kb

input:

500
999
324 675 675 324 675 675 675 675 675 324 675 324 675 324 324 675 324 675 675 675 324 675 324 675 324 675 324 675 324 675 675 324 675 675 675 675 675 324 675 324 675 675 675 675 324 324 675 675 324 324 675 675 324 675 675 675 324 675 324 675 675 675 675 675 675 675 675 675 675 675 675 324 675 ...

output:

999
551
287
639
767
735
511
511
511
783
511
639
703
991
895
879
511
511
511
415
471
503
959
511
511
831
383
511
767
511
103
895
990
767
759
255
767
639
469
959
511
447
703
511
511
895
959
511
959
703
255
879
815
767
975
991
895
983
983
767
987
255
767
511
703
511
860
927
735
511
831
991
767
855
127
...

result:

ok 500 numbers

Test #17:

score: 0
Accepted
time: 20ms
memory: 3716kb

input:

50
10000
3548 5617 5617 3548 3548 1832 5617 5617 5617 3548 5617 5617 3548 5617 4445 3548 3548 3548 3548 5617 3548 5617 5617 5617 3548 3548 3548 5617 3548 5617 5617 3548 3548 5617 4470 3548 3548 5617 5617 5617 5617 5617 3548 5617 5617 3339 5617 3548 3548 6761 3548 3548 5617 3548 5617 5617 3548 3548 3...

output:

8191
4095
9343
9711
6143
6143
8191
6143
9939
5631
7487
8191
9215
9215
9215
8191
8191
8191
1535
8191
7679
7167
6142
8188
2047
9855
9215
6143
7999
9654
4095
7791
9263
6143
9215
5375
8382
9215
4095
7623
8191
8191
6143
3327
8063
7167
7167
4095
8191
8191

result:

ok 50 numbers

Test #18:

score: 0
Accepted
time: 22ms
memory: 3644kb

input:

500
999
675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 675 ...

output:

999
551
287
639
767
735
511
511
511
783
511
639
703
991
895
879
511
511
511
415
471
503
959
511
511
831
383
511
767
511
103
895
990
767
759
255
767
639
469
959
511
447
703
511
511
895
959
511
959
703
255
879
815
767
975
991
895
983
983
767
987
255
767
511
703
511
860
927
735
511
831
991
767
855
127
...

result:

ok 500 numbers

Extra Test:

score: 0
Extra Test Passed