結果

問題 No.1009 面積の求め方
ユーザー T1610T1610
提出日時 2020-03-20 21:25:20
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 992 bytes
コンパイル時間 1,382 ms
コンパイル使用メモリ 164,420 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 14:57:52
合計ジャッジ時間 2,633 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 13 ms
4,376 KB
testcase_03 AC 47 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 24 ms
4,380 KB
testcase_07 AC 19 ms
4,380 KB
testcase_08 AC 17 ms
4,376 KB
testcase_09 AC 6 ms
4,380 KB
testcase_10 AC 9 ms
4,376 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 21 ms
4,376 KB
testcase_13 AC 26 ms
4,376 KB
testcase_14 AC 30 ms
4,376 KB
testcase_15 AC 39 ms
4,380 KB
testcase_16 AC 44 ms
4,376 KB
testcase_17 AC 29 ms
4,376 KB
testcase_18 AC 41 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    cout << fixed << setprecision(15);
    double a, b;
    cin >> a >> b;
    double ans = 0;
    double d = (1.0)/1e6;
    for(double i = min(a, b); i < max(a, b); i += d) {
        double k = (i-a)*(i-b);
        if(k < 0) ans -= k * d;
    }
    cout << ans << endl;
    return 0;
}
0