Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
35149 方巾予 【S】T1 C++ 运行超时 0 1000 MS 31500 KB 609 2024-11-28 13:38:01

Tests(0/3):


#include<bits/stdc++.h> using namespace std; const int N=4e6+10; int n,k; int x[N],y[N]; int cntx,cnty; int ans; void init(){ for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ x[++cntx]=i*i+j*j; } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ y[++cnty]=j*j-i*i; } } } signed main(){ //freopen("test.in","r",stdin); scanf("%d%d",&n,&k); init(); for(int i=1;i<=cntx;i++){ for(int j=1;j<=cnty;j++){ if(i==j+k) ans++; } } printf("%d\n",ans); return 0; }


测评信息: