結果

問題 No.1593 Perfect Distance
ユーザー olpheolphe
提出日時 2021-07-09 21:44:43
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 885 bytes
コンパイル時間 777 ms
使用メモリ 3,560 KB
最終ジャッジ日時 2023-02-01 22:47:18
合計ジャッジ時間 1,898 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,448 KB
testcase_01 AC 2 ms
3,448 KB
testcase_02 AC 1 ms
3,452 KB
testcase_03 AC 1 ms
3,556 KB
testcase_04 AC 1 ms
3,388 KB
testcase_05 AC 1 ms
3,452 KB
testcase_06 AC 1 ms
3,504 KB
testcase_07 AC 1 ms
3,384 KB
testcase_08 AC 1 ms
3,380 KB
testcase_09 AC 1 ms
3,560 KB
testcase_10 AC 1 ms
3,540 KB
testcase_11 AC 1 ms
3,480 KB
testcase_12 AC 1 ms
3,480 KB
testcase_13 AC 2 ms
3,560 KB
testcase_14 AC 1 ms
3,380 KB
testcase_15 AC 1 ms
3,508 KB
testcase_16 AC 2 ms
3,488 KB
testcase_17 AC 1 ms
3,452 KB
testcase_18 AC 1 ms
3,452 KB
testcase_19 AC 1 ms
3,508 KB
権限があれば一括ダウンロードができます

ソースコード

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