結果
問題 | No.1009 面積の求め方 |
ユーザー |
|
提出日時 | 2020-05-01 11:16:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 1,563 ms |
コンパイル使用メモリ | 168,124 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-23 14:54:13 |
合計ジャッジ時間 | 2,132 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(x) (x).begin(),(x).end() 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(){ cin.tie(0); ios::sync_with_stdio(false); std::cout<<std::fixed<<std::setprecision(10); double a,b; cin>>a>>b; double di = 100000; double ans=0.0; for(double x=a; x<=b; x+=1/di){ ans += abs((x-a) * (x-b))/di; } cout<<ans<<endl; }