QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#445892#8416. Dzielniki [B]GotoHiotoriCompile Error//C++14541b2024-06-16 16:45:532024-06-16 16:45:54

Judging History

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

  • [2024-06-16 16:45:54]
  • 评测
  • [2024-06-16 16:45:53]
  • 提交

answer

#include<stdio.h>
#include"dzilib.h"
typedef long long ll;
ll work(ll y,int k){
	if(k==57)return (1ll<<k)-y;
	int a=Ask(x+y),b=Ask(x+y+(1ll<<k));
	ll x;
	if(a%(k+1)==0){
		for(int i=k+2;i<=58;++i)
			if(b%i==0){
				x=work(y|1ll<<k,k+1);
				if(~x)return x;
				break;
			}
	}
	if(b%(k+1)==0){
		for(int i=k+2;i<=58;++i)
			if(a%i==0){
				x=work(y,k+1);
				if(~x)return x;
				break;
			}
	}
	return -1;
}
int main(){
	int t=GetT(),n=GetN();ll q=GetQ(),c=GetC();
	for(;t--;Answer(work(114514,0)));
	return 0;
}

详细

implementer.cpp: In function ‘long long int Ask(long long int)’:
implementer.cpp:254:18: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  254 |         for(auto [x,y]:mp) res=res*(y+1);
      |                  ^
answer.code: In function ‘ll work(ll, int)’:
answer.code:6:19: error: ‘x’ was not declared in this scope
    6 |         int a=Ask(x+y),b=Ask(x+y+(1ll<<k));
      |                   ^
answer.code:10:28: error: ‘b’ was not declared in this scope
   10 |                         if(b%i==0){
      |                            ^
answer.code:16:12: error: ‘b’ was not declared in this scope
   16 |         if(b%(k+1)==0){
      |            ^