結果

問題 No.800 四平方定理
ユーザー CuriousFairy315CuriousFairy315
提出日時 2019-03-17 21:46:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 681 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 67,420 KB
実行使用メモリ 36,396 KB
最終ジャッジ日時 2023-09-22 04:51:55
合計ジャッジ時間 2,932 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,664 KB
testcase_01 AC 2 ms
5,428 KB
testcase_02 AC 3 ms
5,696 KB
testcase_03 AC 2 ms
5,388 KB
testcase_04 AC 2 ms
5,452 KB
testcase_05 AC 2 ms
5,704 KB
testcase_06 AC 2 ms
5,468 KB
testcase_07 AC 2 ms
5,592 KB
testcase_08 AC 2 ms
5,428 KB
testcase_09 AC 3 ms
5,572 KB
testcase_10 AC 26 ms
21,832 KB
testcase_11 AC 30 ms
21,784 KB
testcase_12 AC 29 ms
21,828 KB
testcase_13 AC 27 ms
21,848 KB
testcase_14 AC 31 ms
21,948 KB
testcase_15 AC 33 ms
21,784 KB
testcase_16 AC 34 ms
23,820 KB
testcase_17 AC 34 ms
23,824 KB
testcase_18 AC 33 ms
23,824 KB
testcase_19 AC 35 ms
23,824 KB
testcase_20 AC 2 ms
5,388 KB
testcase_21 AC 2 ms
5,512 KB
testcase_22 AC 34 ms
23,996 KB
testcase_23 AC 80 ms
36,104 KB
testcase_24 AC 81 ms
36,196 KB
testcase_25 AC 84 ms
36,108 KB
testcase_26 AC 2 ms
5,660 KB
testcase_27 AC 2 ms
5,448 KB
testcase_28 AC 81 ms
36,120 KB
testcase_29 AC 89 ms
36,396 KB
testcase_30 AC 81 ms
36,124 KB
testcase_31 AC 73 ms
34,244 KB
testcase_32 AC 77 ms
36,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std; // 575

int main() {
	int N, D;
	cin >> N >> D;
	++ N;
	int ans = 0;
	static int tempura_killer[16000000];
	for (int z = 1;z < N;++ z) for (int w = 1;w < N;++ w) ++ tempura_killer[8000000 - (w + z) * (w - z)];
	for (int x = 1;x < N;++ x) for (int y = 1;y < N;++ y) ans += tempura_killer[x * x + y * y - D + 8000000];
	cout << ans;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

2個ずつに分けて計算
*/
0