【AtCoder】ABC 449 A - π

A - π
AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online.
AtCoder
実行時間制限: 2 sec / メモリ制限: 1024 MiB / Difficulty: 30 / NoviSteps: ??? / 配点: 100 点
問題概要
正整数 が与えられるので、直径が の円の面積を求めよ。
制約
- 入力される値は整数
考察
を計算して出力すればよい。
実装例
CPP
1.#include <bits/stdc++.h>2.using namespace std;3. 4.#define fix(x) fixed << setprecision(x)5. 6.constexpr auto PI = 3.14159265358979;7. 8.// ======================================== //9. 10.int main()11.{12. int D;13. cin >> D;14. 15. cout << fix(10) << (double)PI * D * D / 4 << endl;16. 17. return 0;18.}
Submission #74139475 - AtCoder Beginner Contest 449
AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online.
AtCoder
実装時間: 5 分以内
コメント
まあ 3/14 開催だから何かしら出るとは思ってた。





