UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213095#2348. LifeKXGCompile Error//C++830b2024-11-09 19:56:112024-11-09 23:09:07

answer

#include <cstdio>
#include <unordered_map>
using namespace std;
unordered_map<long long, pair<int, int> > mp;
long long l, q, x;
long long calc(long long x) {
    return x * x * x;
}
int main() {
    scanf("%lld%lld", &l, &q);
    for (int i = -l; i <= l; i++) {
        for (int j = -l; j <= l; j++) {
            mp[calc(i) + calc(j)] = {i, j};
        }
    }
    for (int i = 1; i <= q; i++) {
        scanf("%lld", &x);
        int a = l + 1, b = l + 1, c = l + 1;
        for (int j = -l; j <= l; j++) {
            long long sub = x - calc(j);
            if (mp.count(sub)) {
                auto [x, y] = mp[sub];
                a = y;
                b = x;
                c = j;
                break;
            }
        }
        printf("%d %d %d\n", a, b, c);
    }
    return 0;
}

详细

In file included from /usr/include/c++/4.8/unordered_map:35:0,
                 from answer.code:2:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
answer.code:4:1: error: 'unordered_map' does not name a type
 unordered_map...