QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187661#4912. WereYouLastCrysflyCompile Error//C++20510b2023-09-24 20:11:342023-09-24 20:11:34

Judging History

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

  • [2023-09-24 20:11:34]
  • 评测
  • [2023-09-24 20:11:34]
  • 提交

answer

// what is matter? never mind. 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

bool query(int);
void modify(int,bool);

bool WereYouLast(int n,int m){
	if(n==(1<<10)){
		int p=1;
		while(p<=10 && query(p)) modify(p,0),++p;
		if(p==11)return 1;
		modify(p,1);
		return 0;
	}
	int t=0,x=0;
	For(i,0,4)if(query(i+1))t|=(1<<i);
	if((1<<t)==n)return 1;
	bool bo=query(t+6);
	if(!bo) modify(t+6,1),t=0;
	else modify(t+6,0),t++;
	For(i,0,4) modify(i+1,t>>i&1);
	return 0;
}

详细

answer.code: In function ‘bool WereYouLast(int, int)’:
answer.code:17:13: error: ‘i’ was not declared in this scope
   17 |         For(i,0,4)if(query(i+1))t|=(1<<i);
      |             ^
answer.code:17:9: error: ‘For’ was not declared in this scope
   17 |         For(i,0,4)if(query(i+1))t|=(1<<i);
      |         ^~~