結果

問題 No.800 四平方定理
ユーザー heno239heno239
提出日時 2019-03-14 14:39:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,150 bytes
コンパイル時間 915 ms
コンパイル使用メモリ 109,552 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-14 12:09:31
合計ジャッジ時間 4,916 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,864 KB
testcase_01 AC 32 ms
4,380 KB
testcase_02 AC 20 ms
4,376 KB
testcase_03 AC 23 ms
4,380 KB
testcase_04 AC 18 ms
4,380 KB
testcase_05 AC 22 ms
4,504 KB
testcase_06 AC 41 ms
4,376 KB
testcase_07 AC 28 ms
4,376 KB
testcase_08 AC 42 ms
4,376 KB
testcase_09 AC 34 ms
4,376 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ld INF = (ld)10000000000000;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
bitset<6750001> b;

int main() {
	int n, d; cin >> n >> d;
	int ans = 0;
	rep1(i, n) {
		b[i*i + d] = 1;
	}
	rep1(i, n) {
		rep1(j, n) {
			rep1(k, n) {
				if (b[i*i + j * j + k * k])ans++;
			}
		}
	}
	cout << ans << endl;
	//stop
	return 0;
}
0