记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 1ms 212.0 KiB
#2 Time Exceeded ≥1003ms ≥128.0 KiB
#3 Accepted 0ms 128.0 KiB
#4 Accepted 0ms 212.0 KiB
#5 Time Exceeded ≥1003ms ≥216.0 KiB
#6 Time Exceeded ≥1002ms ≥208.0 KiB
#7 Time Exceeded ≥1002ms ≥216.0 KiB
#8 Time Exceeded ≥1001ms ≥204.0 KiB
#9 Time Exceeded ≥1000ms ≥212.0 KiB
#10 Time Exceeded ≥1005ms ≥204.0 KiB

代码

#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
  int n,a,b,c,sum=0,yi=0,m;
  scanf("%d",&n);
  for(a=1;a<=n/3;a++){
  	for(m=2*a;m<=n-a;m++){
  		if(((a*a-1)%m==0&&a!=1)||(a==1&&m%2==0)){c=(m+(a*a-1)/m)/2;
  		                b=(m-(a*a-1)/m)/2;
  		    if(a<=b&&b<=c){ 
			  if(sum==0)yi=(a+b)^c;
  				else yi=yi^(a+b)^c;
				  sum++;
				//  printf("%d %d %d %d\n",a,b,c,m);
			  }
  			   
		  }
	  }
  }
printf("%d %d",sum,yi);
return 0;
}

信息

递交者
类型
递交
题目
P1003 hitwh 2019 新生赛 D Songer 的排兵布阵
语言
C
递交时间
2020-12-17 19:20:50
评测时间
2020-12-17 19:20:50
评测机
分数
30
总耗时
≥7021ms
峰值内存
≥216.0 KiB