Axolotl_awa @ 2024-04-02 21:42:46
为什么比赛时AC的代码在洛谷50分?(纯提问,不是对数据有质疑)
by Axolotl_awa @ 2024-04-07 15:47:45
@life_is_movie 所以,要at管理员吗
by chenshenqi @ 2024-04-07 15:57:25
我也遇到了这种情况,请求修改数据
by life_is_movie @ 2024-04-07 16:24:29
@wuboyan714 艾特吧
by Eason_cyx @ 2024-04-07 21:17:10
@一扶苏一
by yi105011 @ 2024-04-12 20:44:40
@life_is_movie 那得将sqrt(s)给改成int(sqrt(s))才行
by rogerfrz @ 2024-08-21 15:52:26
if(sqrt(a[i]+a[j])long(sqrt(a[i]+a[j]))==0)
by cuixizhou @ 2024-09-06 20:49:30
代码来啦!
(萌新,还请带路)
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a[1005],g=0;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) if(int(sqrt(a[i]+a[j]))==sqrt(a[i]+a[j]*1.0)) g++;
cout<<g;
return 0;
}