結果
| 問題 | No.1593 Perfect Distance |
| コンテスト | |
| ユーザー |
Narumisakakios
|
| 提出日時 | 2021-07-09 22:19:43 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 840 ms |
| コンパイル使用メモリ | 179,092 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-03 10:15:51 |
| 合計ジャッジ時間 | 11,100 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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