結果

問題 No.1009 面積の求め方
ユーザー hanachanXhanachanX
提出日時 2020-04-12 14:27:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 990 bytes
コンパイル時間 3,437 ms
コンパイル使用メモリ 178,464 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 01:14:15
合計ジャッジ時間 3,694 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
#define repr(i ,n) for(int i=n;i>(int)(n);--i)
#define rep1(i ,n) for(int i=1;i<=(int)(n);++i)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define PRINT(x) printf("%d\n",(x));
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;
template<class T> using V = vector<T>;
using I = int;
using VI = V<I>;
const int INF = 2e9;
const int64 MOD = 1e9 + 7;

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

int main(){
    int a , b; cin >> a >> b;
    double step=0.000001;
    double sum = 0;
    double i = (double)a + step;
    for( i ; i < b ; i += step){
        sum+=abs(( i - a) * ( i - b )*(step));
    }
    cout << fixed << sum << endl;
}
0