QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#186268#1085. Brave Seekers of Unicornsyjf1225RE 0ms0kbC++14628b2023-09-23 15:47:292023-09-23 15:47:29

Judging History

This is the latest submission verdict.

  • [2023-09-23 15:47:29]
  • Judged
  • Verdict: RE
  • Time: 0ms
  • Memory: 0kb
  • [2023-09-23 15:47:29]
  • Submitted

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>

typedef long long LL;

using namespace std;

namespace yjf{
	const int N=1000010;
	
	LL f[N];
	
	int main(){
		int n,Mod;
		scanf("%d%d",&n,&Mod);
		
		LL ans=0;
		f[0]=1;
		for(int i=1;i<=n;i++){
			for(int j=0;j<i;j++){
				f[i]+=f[j];
				f[i]%=Mod;
				if((i^j)<j){
					f[i]-=f[i^j];
					f[i]=(f[i]%Mod+Mod)%Mod;
				}
			}
			ans+=f[i];
			ans%=Mod;
		}
		
		printf("%lld\n",ans);
		
		return 0;
	}
}

int main(){
	//freopen("xor.in","r",stdin);
	//freopen("xor.out","w",stdout);
	
	return yjf::main();
}

详细

Test #1:

score: 0
Runtime Error

input:

1

output:


result: