結果

問題 No.1009 面積の求め方
ユーザー woyuki_
提出日時 2020-04-27 00:06:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 1,772 ms
コンパイル使用メモリ 166,044 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-19 01:29:11
合計ジャッジ時間 2,647 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (int)n;i++)
#define repb(i,n) for(int i = (int)n;i >= 0;i--)
#define reps(i,m,n) for(int i = (int)m;i < (int)n;i++)
#define repsb(i,m,n) for(int i = (int)m;i >= (int)n;i--)
#define SORT(v,n) sort(v,v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999999999999
#define ll long long int
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1;} return 0;}
//vector<vector<int>> vec(n_rows, vector<int>(n_cols, value));
using namespace std;
int main(int argc, char const *argv[]) {
   double a, b,n,i;
   cin >>a>>b;
   i = a;
   n = 10000;
   double ans = 0;
   while(i < b)
   {
      ans += abs((i - a) * (i - b) )/ n;
      i+=1/n;
   }
   cout << ans<<endl;
}
0