Submission #3545300
Source Code Expand
#include<iostream> #include<string> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<vector> #include<functional> #include<iomanip> #include<queue> #include<cassert> #include<tuple> #include<set> #include<map> #include<list> #include<bitset> #include<utility> #include<numeric> #define pb push_back #define mp make_pair #define all(a) (a).begin(),(a).end() #define dwn(a) (a).begin(),(a).end(), greater<int>() #define rep(i, m) for (int i = 0; i < m; i++) #define REP(i, n, m) for (int i = n; i < m; i++) #define V vector<int> #define VV vector<V> #define VVV vector<VV> using namespace std; typedef long long ll; typedef pair<int, int> P; const int dx[4] = { 1, 0, -1, 0 }; const int dy[4] = { 0, 1, 0, -1 }; const int INF = (int)1e9; const ll inf = (ll)1e18; const ll MOD{ (ll)1e9 + 7 }; const long double EPS = 1e-10; double r, n, m; double length(double m) { if (m <= 0 || n <= m) return 0; m = min(m, n - m); double d = r - 2 * r * m / n; return 2 * sqrt(r * r - d * d); } int main() { cin >> r >> n >> m; double ans = 0.0; for (int i = 1; i <= n + m - 1; i++) { ans += max(length(i), length(i - m)); } cout << fixed << setprecision(10) << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - ステップカット |
User | tako_39 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1279 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_hand_01.txt, 20_hand_02.txt, 20_hand_03.txt, 20_hand_04.txt, 20_hand_05.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
00_example_03.txt | AC | 3 ms | 256 KB |
10_rand_01.txt | AC | 1 ms | 256 KB |
10_rand_02.txt | AC | 1 ms | 256 KB |
10_rand_03.txt | AC | 2 ms | 256 KB |
10_rand_04.txt | AC | 1 ms | 256 KB |
10_rand_05.txt | AC | 1 ms | 256 KB |
10_rand_06.txt | AC | 1 ms | 256 KB |
10_rand_07.txt | AC | 1 ms | 256 KB |
10_rand_08.txt | AC | 1 ms | 256 KB |
20_hand_01.txt | AC | 3 ms | 256 KB |
20_hand_02.txt | AC | 3 ms | 256 KB |
20_hand_03.txt | AC | 3 ms | 256 KB |
20_hand_04.txt | AC | 1 ms | 256 KB |
20_hand_05.txt | AC | 1 ms | 256 KB |