ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213095 | #2348. Life | KXG | Compile Error | / | / | C++ | 830b | 2024-11-09 19:56:11 | 2024-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...