結果
| 問題 |
No.1593 Perfect Distance
|
| コンテスト | |
| ユーザー |
Narumisakakios
|
| 提出日時 | 2021-07-09 22:19:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 364 bytes |
| コンパイル時間 | 1,487 ms |
| コンパイル使用メモリ | 165,888 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-07-01 16:57:20 |
| 合計ジャッジ時間 | 12,199 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 14 TLE * 2 -- * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll N;cin>>N;
ll ans = 0;
for(ll i=1;i<=N;i++){
for(ll j=i;j<=N;j++){
if((i*i)+(j*j)==N*N){
ans+=2;
if(i==j)ans-=1;
}
if((i*i)+(j*j)>=N*N)break;
}
}
cout<<ans<<endl;
}
Narumisakakios