結果

問題 No.1593 Perfect Distance
ユーザー olpheolphe
提出日時 2021-07-09 21:44:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 885 bytes
コンパイル時間 964 ms
コンパイル使用メモリ 109,680 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 15:44:00
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	N *= N;
	for (long long int i = 1; i * i < N; i++) {
		long long box = sqrt(N - i * i) + 0.1;
		if (i * i + box * box == N) {
			
			M++;
		}
	}
	cout << M << endl;
}
0