結果
問題 | No.1009 面積の求め方 |
ユーザー | chocobo |
提出日時 | 2020-03-20 21:46:46 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 818 bytes |
コンパイル時間 | 935 ms |
コンパイル使用メモリ | 103,504 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-05-08 21:33:53 |
合計ジャッジ時間 | 1,723 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 3 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
ソースコード
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <sstream> #include <map> #include <set> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #include <typeinfo> #include <numeric> #include <functional> #include <unordered_map> #include <bitset> #include <stack> #include <assert.h> #include <unordered_set> #include <random> using namespace std; using ll = long long; using ull = unsigned long long; const ll INF = 1e18; const ll MOD = 1e9 + 7; #define REP(i, n) for(ll i = 0; i < n; i++) int main(){ double a, b; scanf("%lf %lf", &a, &b); double s = 0, n = 100000.0; for(double i = 1.0; i <= n; i += 1.0){ s += (b - a) / n * abs((a + (b - a) / n * i - a) * (a + (b - a) / n * i - b)); } printf("%.6lf\n", s); }