結果
| 問題 |
No.1593 Perfect Distance
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-09 21:24:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 309 bytes |
| コンパイル時間 | 480 ms |
| コンパイル使用メモリ | 64,964 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 15:01:33 |
| 合計ジャッジ時間 | 1,284 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 4 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
long N;
long isq(long A)
{
long L=0,R=A;
while(R-L>1)
{
long M=L+R>>1;
if(M*M<A)L=M;
else R=M;
}
return R;
}
main()
{
cin>>N;
long ans=0;
for(long x=1;x<N;x++)
{
long y2=N*N-x*x;
long y=isq(y2);
if(y*y==y2)
{
ans++;
}
}
cout<<ans<<endl;
}