結果
問題 | No.1143 面積Nの三角形 |
ユーザー |
|
提出日時 | 2020-07-31 21:59:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 800 ms |
コード長 | 1,130 bytes |
コンパイル時間 | 680 ms |
コンパイル使用メモリ | 91,872 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-06 18:00:42 |
合計ジャッジ時間 | 1,428 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<vector>#include<map>#include<set>#include<string>#include<queue>#include<stack>#include<complex>using namespace std;#define MOD 1000000007#define MOD2 998244353#define INF (1<<29)#define LINF (1LL<<60)#define EPS (1e-10)#define PI 3.1415926535897932384626433832795028typedef long long Int;typedef pair<Int, Int> P;typedef long double Real;typedef complex<Real> CP;Int ans = 0;Int n;vector<Int> divs;int main(){cin >> n;for(Int i = 1;i <= n;i++){if((n * n) % i)continue;divs.push_back(i);}for(Int i = 0;i < divs.size();i++){Int x = divs[i];for(Int j = i;j < divs.size();j++){Int y = divs[j];if(x*y*(x+y) > n*n)break;for(Int k = j;k < divs.size();k++){Int z = divs[k];Int ss = x * y * z * (x + y + z);if(ss > n*n)break;if(ss == n*n){ans++;}}}}cout << ans << endl;return 0;}