UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213098#2348. LifeSTASISZHYCompile Error//C++928b2024-11-09 19:57:192024-11-09 23:09:40

answer

#include<bits/stdc++.h>
//#define int long long
#define fi first
#define se second
#define PII pair<int, int>

using namespace std;

const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, INF = 0x3f3f3f3f;

int n, m, q, ans;
int s[N], dp[N];

vector<int> e[N], v;
unordered_map<int, int> mp;

signed main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n >> q;
	for(int i = -1 * n; i <= n; i ++) mp[i * i * i] = i, v.push_back(i * i * i); 
	while(q --)
	{
		int x; cin >> x; bool flag = false;
		for(int i = 0; i < v.size(); i ++)
		{
			if(flag) break;
			for(int j = i; j < v.size(); j ++)
			{
				int now = x - v[i] - v[j];
				if(now < v[0]) break;
				if(mp[now])
				{
					flag = true;
					cout << mp[v[j]] << ' ' << mp[now] << ' ' << mp[v[i]] << '\n';
					break; 
				}
			}
		}
		if(!flag) cout << n + 1 << ' ' << n + 1 << ' ' << n + 1 << '\n';
	}	
	return 0;
}

详细

answer.code:15:1: error: 'unordered_map' does not name a type
 unordered_map<int, int> mp;\x0d
 ^
answer.code: In function 'int main()':
answer.code:21:36: error: 'mp' was not declared in this scope
  for(int i = -1 * n; i <= n; i ++) mp[i * i * i] = i, v.push_back(i * i * i); \x0d
                                    ^
answer.code:32:8: error: 'mp' was not declared in this scope
     if(mp[now])\x0d
        ^