样例过AW求助.
查看原帖
样例过AW求助.
1050994
Lucid楼主2024/4/10 19:38
#include<bits/stdc++.h>
using namespace std;

#define ll long long
ll l,r,ans;

int main() {
    cin>>l>>r;
    for(ll y=l;y<=r;++y) {
    	for(ll x=l;x<=r;++x) {
    		ll t=y*y-x;
		ll z=sqrt(t);
		if(z*z==t) {
		   ++ans;
		}
	}
    }
    cout<<ans;
    return 0;
}
2024/4/10 19:38
加载中...