結果

問題 No.1143 面積Nの三角形
ユーザー kyoprounokyoprouno
提出日時 2020-08-01 14:45:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 800 ms
コード長 1,234 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 175,500 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 10:17:06
合計ジャッジ時間 3,360 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 8 ms
4,384 KB
testcase_09 AC 10 ms
4,384 KB
testcase_10 AC 9 ms
4,384 KB
testcase_11 AC 10 ms
4,380 KB
testcase_12 AC 12 ms
4,384 KB
testcase_13 AC 14 ms
4,384 KB
testcase_14 AC 12 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 19 ms
4,380 KB
testcase_17 AC 22 ms
4,380 KB
testcase_18 AC 21 ms
4,380 KB
testcase_19 AC 20 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

const ll INF=1e18;
const ll mod=1e9+7;
const double eps=0.000000001;

int main(){
    ll n;
    cin >> n;
    vector<ll> divs;
    for(ll i=1;i<=n;i++){
        if(n*n%i==0){
            divs.push_back(i);
        }
    }
    ll ans=0;
    for(ll i=0;i<divs.size();i++){
        ll x=divs[i];
        for(ll j=i;j<divs.size();j++){
            ll y=divs[j];
            if(x*y*(x+y)>n*n) break;
            for(ll k=j;k<divs.size();k++){
                ll z=divs[k];
                if(x*y*z*(x+y+z)>n*n) break;
                if(x*y*z*(x+y+z)==n*n) ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}
0