UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213118#2348. LifejaxCompile Error//C++1.4kb2024-11-09 20:24:342024-11-09 23:14:51

answer

#include<bits/stdc++.h>
using namespace std;
namespace io{
	char buf[1<<20],*p1=buf,*p2=buf;
#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin)),p1==p2?EOF:*p1++)
	int read(){
		int x=0,f=0;char c=gc();
		while(c< '0'||c> '9') f|=c=='-',c=gc();
		while(c>='0'&&c<='9') x=x*10+(c^48),c=gc();
		return f?-x:x;
	}
	char pbuf[1<<20],*pp=pbuf;
#define flush() (fwrite(pbuf,1,pp-pbuf,stdout),pp=pbuf)
#define pc(ch) (pp==pbuf+(1<<20)&&flush(),*pp++=(ch))
	class Flush{public:~Flush(){flush();}}_;
	void write(int x,char ch=0){
		if(x<0) pc('-'),x=-x;
		static int st[35];int top=0;
		do st[top++]=x%10,x/=10;while(x);
		while(top) pc(st[--top]^48);if(ch) pc(ch);
	}
	void putc(char ch){pc(ch);}
}
#define ll long long
int x3[2009];
unordered_map<int,pair<int,int> >mp;
int main(){
//	freopen("in.in","r",stdin);
	int L,q;
	L=io::read();
	q=io::read();
	for(int i=-L;i<=L;i++)
		x3[i+L]=i*i*i;
	for(int i=-L;i<=L;i++)
		for(int j=-L;j<=L;j++)
			if(!mp.count(x3[i+L]+x3[j+L]))
				mp[x3[i+L]+x3[j+L]]={i,j};
	while(q--){
		int x,ok=0;
		x=io::read();
		for(int k=-L;k<=L;k++)
			if(mp.count(x-x3[k+L])){
				auto p=mp[x-x3[k+L]];
				io::write(k,' ');
				io::write(p.first,' ');
				io::write(p.second,'\n');
				ok=1;break;
			}
		if(!ok){
			io::write(L+1,' ');
			io::write(L+1,' ');
			io::write(L+1,'\n');
		}
	}
	return 0;
}

详细

answer.code:26:1: error: 'unordered_map' does not name a type
 unordered_map<int,pair<int,int> >mp;\x0d
 ^
answer.code: In function 'int main()':
answer.code:36:8: error: 'mp' was not declared in this scope
    if(!mp.count(x3[i+L]+x3[j+L]))\x0d
        ^
answer.code:37:29: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
     mp[x3[i+L]+x3[j+L]]={i,j};\x0d
                             ^
answer.code:42:7: error: 'mp' was not declared in this scope
  ...