結果

問題 No.800 四平方定理
ユーザー urayamakoutarou
提出日時 2019-04-29 15:12:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 54,620 KB
実行使用メモリ 13,696 KB
最終ジャッジ日時 2024-12-24 11:55:11
合計ジャッジ時間 89,944 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other AC * 2 WA * 1 TLE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int N ,D,a,b,c,d,s;
	cin >> N >> D;
	s = 0;
	a = 1;
	b = 1;
	c = 1;
	d = 1;
	while (a <= N) {
		while (b <= N) {
			while (c <= N) {
				while(d<=N){
					if (a*a + b * b + c * c - d * d == D) {
						
						s++; }
					
					d++;
				}d = 1;c++;
			}c = 0;b++;
		}b = 0;a++;
	}
	cout << s << endl;
	return 0;
}
0