結果
| 問題 | No.1593 Perfect Distance |
| コンテスト | |
| ユーザー |
Narumisakakios
|
| 提出日時 | 2021-07-09 22:18:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 1,503 ms |
| コンパイル使用メモリ | 165,912 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-01 16:55:03 |
| 合計ジャッジ時間 | 12,302 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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-=2;
}
if((i*i)+(j*j)>=N*N)break;
}
}
cout<<ans<<endl;
}
Narumisakakios