結果
問題 | No.1009 面積の求め方 |
ユーザー |
![]() |
提出日時 | 2020-03-28 19:23:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 391 bytes |
コンパイル時間 | 2,051 ms |
コンパイル使用メモリ | 160,796 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 12:02:02 |
合計ジャッジ時間 | 2,665 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int,int> P; int main() { double N = pow(10, 3); double a, b; cin >> a >> b; double S = 0; double div = (b - a) / N; for (double i = a; i < b;i+=1/N) { double tmp = abs((i - a) * (i - b)) / N; S += tmp; } cout << fixed <<S << endl; }