QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#583771#9308. World CupEnigmaAC ✓3ms3768kbC++234.5kb2024-09-22 22:09:402024-09-22 22:09:46

Judging History

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

  • [2024-09-22 22:09:46]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3768kb
  • [2024-09-22 22:09:40]
  • 提交

answer

// #define NDEBUG

#define ce constexpr
#define tt template <typename T>
#define tt_ template <typename... T>
#define tn template <size_t N>
#define bs binary_search
#define ps partial_sum
#define ad adjacent_difference
#define rc reverse_copy
#define nthe nth_element
#define maxe max_element
#define mine min_element
#define np next_permutation
#define pp prev_permutation
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define eb emplace_back
#define whole(x) (x).begin(), (x).end()
#define rwhole(x) (x).rbegin(), (x).rend()

#include <bits/stdc++.h>
// #include <bits/extc++.h>

using ll = long long;
using lll = __int128_t;
using ld = long double;
using uchar = unsigned char;
using ushort = unsigned short;
using uint = unsigned int;
using ull = unsigned long long;
using ulll = __uint128_t;
ce int mod9 = 998244353;
ce int mod10 = 1000000007;
ce int inf = 0x3f3f3f3f;
ce int neginf = 0xc0c0c0c0;
ce ll infll = 0x3f3f3f3f3f3f3f3f;
ce ll neginfll = 0xc0c0c0c0c0c0c0c0;
tt ce T &maxeq(T &a, const T &b) { return a < b ? (a = b) : a; }
tt ce T &mineq(T &a, const T &b) { return a > b ? (a = b) : a; }
ce int mylog(uint x) { return 31 - __builtin_clz(x); }
ce int mylogll(ull x) { return 63 - __builtin_clzll(x); }

using namespace std;
tt_ using vec = vector<T...>;
tt_ using mset = multiset<T...>;
tt_ using mmap = multimap<T...>;
tt_ using uset = unordered_set<T...>;
tt_ using umap = unordered_map<T...>;
tt_ using umset = unordered_multiset<T...>;
tt_ using ummap = unordered_multimap<T...>;
tt_ using pq = priority_queue<T...>;
tt_ using ii = istream_iterator<T...>;
tt_ using oi = ostream_iterator<T...>;
using pbb = pair<bool, bool>;
using pbi = pair<bool, int>;
using pbd = pair<bool, double>;
using pib = pair<int, bool>;
using pii = pair<int, int>;
using pid = pair<int, double>;
using pdb = pair<double, bool>;
using pdi = pair<double, int>;
using pdd = pair<double, double>;
using vb = vec<bool>;
using vbr = vb::reference;
using vbp = vb::pointer;
using vbt = vb::iterator;
using vbrt = vb::reverse_iterator;
using vvb = vec<vb>;
using vi = vec<int>;
using vit = vi::iterator;
using virt = vi::reverse_iterator;
using vvi = vec<vi>;
using vd = vec<double>;
using vdt = vd::iterator;
using vdrt = vd::reverse_iterator;
using vvd = vec<vd>;
using vpii = vec<pii>;
using vpiit = vpii::iterator;
using vpiirt = vpii::reverse_iterator;
using vvpii = vec<vpii>;
using vs = vec<string>;
using vst = vs::iterator;
using vsrt = vs::reverse_iterator;
using vvs = vec<vs>;
using gbool = greater<bool>;
using gint = greater<int>;
using gdouble = greater<double>;
using gpii = greater<pii>;
using gstring = greater<string>;
inline vbr operator^=(vbr a, const bool &b) { return a = a ^ b; }
inline vbr operator&=(vbr a, const bool &b) { return a = a && b; }
inline vbr operator|=(vbr a, const bool &b) { return a = a || b; }
tn inline bitset<N>::reference operator^=(typename bitset<N>::reference a, const bool &b) { return a = a ^ b; }
tn inline bitset<N>::reference operator&=(typename bitset<N>::reference a, const bool &b) { return a = a && b; }
tn inline bitset<N>::reference operator|=(typename bitset<N>::reference a, const bool &b) { return a = a || b; }
tn inline void swap(typename bitset<N>::reference a, typename bitset<N>::reference b)
{
    a ^= b;
    b ^= a;
    a ^= b;
}

// template <typename S, typename T>
// using rbtree = __gnu_pbds::tree<S, __gnu_pbds::null_type, T, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

#undef tt
#undef tt_
#undef tn

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
    {
        vi a(32);
        for (int &i : a)
            cin >> i;
        vi ord(32);
        iota(whole(ord), 0);
        sort(whole(ord), [&](int i, int j)
             { return a[i] < a[j]; });
        for (int i{}; i < 32; ++i)
            if (!ord[i])
            {
                if (i < 2)
                    cout << "32\n";
                else if (i < 6)
                    cout << "16\n";
                else if (i < 13)
                    cout << "8\n";
                else if (i < 27)
                    cout << "4\n";
                else if (i < 31)
                    cout << "2\n";
                else
                    cout << "1\n";
                break;
            }
    }
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

32
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
4 1 2 3 5 6 7 8 9 10 11 12 13 14 15 ...

output:

32
32
16
16
16
16
8
8
8
8
8
8
8
4
4
4
4
4
4
4
4
4
4
4
4
4
4
2
2
2
2
1

result:

ok 32 numbers

Test #3:

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

input:

1000
158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784 450968417 430302156 982631932 161735902 880895728 923078537 707723857 189330739 910286918 802329211 404539679 303238506 317063340 492686568 773361868 125660...

output:

16
4
1
4
1
4
4
2
4
2
4
32
4
2
4
4
8
4
32
1
4
4
2
4
2
16
2
8
4
8
8
1
2
4
8
4
16
4
4
2
4
4
2
16
8
4
2
16
4
8
8
4
4
4
4
16
16
2
1
4
4
8
1
4
4
2
4
8
16
4
4
8
4
32
32
8
8
8
1
4
4
4
4
4
32
8
4
4
8
32
4
4
16
2
8
32
16
8
8
4
1
4
4
16
32
4
4
4
4
4
8
4
4
8
4
4
4
8
16
4
4
8
2
4
4
16
2
8
16
4
4
16
2
32
8
16
4
3...

result:

ok 1000 numbers

Extra Test:

score: 0
Extra Test Passed