| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 39280 | LYLAKIOIAKIOI | 【BJ】T2 | C++ | 运行超时 | 0 | 1000 MS | 78380 KB | 1145 | 2026-01-07 21:06:10 |
#include<bits/stdc++.h> #define ll long long using namespace std; const int N=2e7+20,LM=2e7+5; int buc[N]; void chk(int x,int y,int z){ if(x%8!=0||y%8!=0||z%8!=0) return ; x/=8,y/=8,z/=8; //if(__gcd(__gcd(x,y),z)!=1) return ; buc[max(max(x,y),z)]++; //cout<<"w:"<<x<<' '<<y<<' '<<z<<endl; } int main(){ //freopen("you.in","r",stdin); //freopen("you.out","w",stdout); for(int a=1;a<=2;a++){ for(int q=1;q<=LM;q++){ for(int p=1;p<=LM;p++){ ll y=a*(1ll*q*q+3ll*p*p),z=a*(1ll*q*q-5ll*p*p); //cout<<"v:"<<a<<' '<<q<<' '<<p<<' '<<y<<' '<<z<<endl; if(z<0||y>8ll*LM) break; ll x=0; x=a*(1ll*q*q-1ll*p*p+4ll*q*p);//cout<<x<<endl; if(x>=1&&x<=8ll*LM) chk(x,y,z); x=a*(1ll*q*q-1ll*p*p-4ll*q*p);//cout<<x<<endl; if(x>=1&&x<=8ll*LM) chk(x,y,z); } } } buc[1]++; for(int i=1;i<=N-10;i++) buc[i]+=buc[i-1]; int t;cin>>t; while(t--){ int n;cin>>n; cout<<buc[n]<<'\n'; } return 0; }