結果
問題 | No.800 四平方定理 |
ユーザー |
![]() |
提出日時 | 2019-03-14 14:44:53 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,182 bytes |
コンパイル時間 | 782 ms |
使用メモリ | 23,760 KB |
最終ジャッジ日時 | 2023-02-02 02:58:29 |
合計ジャッジ時間 | 5,952 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,900 KB |
testcase_01 | AC | 2 ms
6,952 KB |
testcase_02 | AC | 2 ms
4,908 KB |
testcase_03 | AC | 2 ms
6,952 KB |
testcase_04 | AC | 1 ms
4,900 KB |
testcase_05 | AC | 2 ms
6,952 KB |
testcase_06 | AC | 2 ms
4,900 KB |
testcase_07 | AC | 2 ms
4,904 KB |
testcase_08 | AC | 2 ms
4,900 KB |
testcase_09 | AC | 2 ms
4,908 KB |
testcase_10 | AC | 14 ms
13,052 KB |
testcase_11 | AC | 15 ms
13,060 KB |
testcase_12 | AC | 15 ms
14,200 KB |
testcase_13 | AC | 12 ms
11,536 KB |
testcase_14 | AC | 14 ms
12,112 KB |
testcase_15 | AC | 15 ms
14,024 KB |
testcase_16 | AC | 14 ms
12,236 KB |
testcase_17 | AC | 14 ms
12,208 KB |
testcase_18 | AC | 17 ms
16,068 KB |
testcase_19 | AC | 19 ms
16,200 KB |
testcase_20 | AC | 1 ms
6,948 KB |
testcase_21 | AC | 1 ms
4,900 KB |
testcase_22 | AC | 17 ms
16,224 KB |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | AC | 2 ms
6,952 KB |
testcase_27 | AC | 2 ms
6,952 KB |
testcase_28 | RE | - |
testcase_29 | RE | - |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | RE | - |
ソースコード
#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; int cnt[7000000]; int main() { int n, d; cin >> n >> d; int ans = 0; rep1(i, n) { rep1(j, n) { if (i*i - j * j + d >= 0) { cnt[i*i - j * j + d]++; } } } rep1(i, n) { rep1(j, n) { ans += cnt[i*i + j * j]; } } cout << ans << endl; //stop return 0; }