记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Accepted 1ms 220.0 KiB
#2 Wrong Answer 2ms 220.0 KiB
#3 Accepted 1ms 224.0 KiB
#4 Accepted 1ms 220.0 KiB
#5 Wrong Answer 1ms 228.0 KiB
#6 Wrong Answer 2ms 216.0 KiB
#7 Wrong Answer 2ms 228.0 KiB
#8 Wrong Answer 1ms 220.0 KiB
#9 Wrong Answer 1ms 224.0 KiB
#10 Wrong Answer 2ms 216.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	int a,b,c;
	cin>>n;
	long long ans;
	a=1;
	int c1b;
	int num=0;
	for(int b=1; a+b+b<=n; b++)
		{
			c=b;
			if(num==0)
				ans=(a+b)^c;
			else
				ans^=(a+b)^c;
			num++;
		}
		b=a;
		c=a;
	for(a=2; a+b+c<=n; a++)
		{
			for(int cb=1; cb<=a*a-1; cb++)
				{
					if(a<=b&&b<=c)
						{
							c1b=a*a-1/cb;
							c=(c1b+cb)/2;
							b=(c1b-cb)/2;
							ans^=(a+b)^c;
							num++;
						}
				}
		}
	cout<<num<<" "<<ans;
}

信息

递交者
类型
递交
题目
P1003 hitwh 2019 新生赛 D Songer 的排兵布阵
语言
C++
递交时间
2020-12-18 11:18:38
评测时间
2020-12-18 11:18:38
评测机
分数
30
总耗时
18ms
峰值内存
228.0 KiB