QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#576052#9308. World CupHaijieTanCompile Error//C++982.1kb2024-09-19 18:08:542024-09-19 18:08:54

Judging History

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

  • [2024-09-19 18:08:54]
  • 评测
  • [2024-09-19 18:08:54]
  • 提交

answer

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstring>
#include<ctime>
#include<random>
#include<deque>
#include<map>
#include<stack>
#include<set>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define lowbit(x) (x & (-x))
const int xy[][2] = { 0,1, 0, -1, 1, 0, -1, 0 };
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<char, char> PCC;
#define x first
#define y second
inline int read();
const int INF = 0x3f3f3f3f, N = 1e5 + 10, MOD = 1e9 + 7, K = 131;
vector<int>a(34), p[9];
int cn = 0;
bool _32() {
    return p[1][0] != cn && p[1][1] != cn;
}
bool _16() {
    if (p[1][2] == cn) {
        return cn > p[2][3];
    }
    else {
        return cn > p[2][2];
    }
}
bool _8() {
    if (p[1][3] == cn) {
        return cn > max(p[3][3], p[4][2]);
    }
    else {
        return cn > max(p[4][3], p[3][2]);
    }
}
bool _4() {
    if (p[1][3] == cn) {
        return cn > max({ p[5][3], p[6][2], p[7][3], p[8][2] });
    }
    else {
        return cn > max({ p[5][2], p[6][3], p[7][2], p[8][3] });
    }
}
void solve() {
    cn = 0;
    bool f = 1;
    for (int i = 1; i <= 8; i++)p[i].clear();
    for (int i = 1; i <= 32; i++) {
        cin >> a[i];
        if (!cn)cn = a[i];
        else if (cn < a[i])f = 0;
        p[i / 4 + i % 4 != 0].pb(a[i]);
        if (i % 4 == 0)sort(all(p[i / 4]));
    }
    if (f)return cout << "1\n", void();
    if (!_32())cout << "32\n";
    else if (!_16())cout << "16\n";
    else if (!_8())cout << "8\n";
    else if (!_4())cout << "4\n";
    else cout << "2\n";
}
signed main() {
    IOS;
    int _ = 1;
    cin >> _;
    while (_--)solve();
    return 0;
}
inline int read()
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch>'9') { if (ch == '-') f = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar(); }
    return x * f;
}

詳細信息

In file included from /usr/include/c++/13/random:37,
                 from answer.code:8:
/usr/include/c++/13/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   32 | #error This file requires compiler and library support \
      |  ^~~~~
answer.code: In function ‘bool _4()’:
answer.code:51:25: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   51 |         return cn > max({ p[5][3], p[6][2], p[7][3], p[8][2] });
      |                         ^
answer.code:51:24: error: no matching function for call to ‘max(<brace-enclosed initializer list>)’
   51 |         return cn > max({ p[5][3], p[6][2], p[7][3], p[8][2] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:51:24: note:   candidate expects 2 arguments, 1 provided
   51 |         return cn > max({ p[5][3], p[6][2], p[7][3], p[8][2] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:51:24: note:   candidate expects 3 arguments, 1 provided
   51 |         return cn > max({ p[5][3], p[6][2], p[7][3], p[8][2] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:54:25: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   54 |         return cn > max({ p[5][2], p[6][3], p[7][2], p[8][3] });
      |                         ^
answer.code:54:24: error: no matching function for call to ‘max(<brace-enclosed initializer list>)’
   54 |         return cn > max({ p[5][2], p[6][3], p[7][2], p[8][3] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:54:24: note:   candidate expects 2 arguments, 1 provided
   54 |         return cn > max({ p[5][2], p[6][3], p[7][2], p[8][3] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:54:24: note:   candidate expects 3 arguments, 1 provided
   54 |         return cn > max({ p[5][2], p[6][3], p[7][2], p[8][3] });
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code: In function ‘long long int read()’:
answer.code:84:33: error: ‘getchar’ was not declared in this scope
   84 |     int x = 0, f = 1; char ch = getchar();
      |                                 ^~~~~~~
answer.code:13:1: note: ‘getchar’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
   12 | #include<set>
  +++ |+#include <cstdio>
   13 | using namespace std;