Submission #4028617
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX const double EPS = 1e-14; const double PI = acos(-1.0); int main(){ double r, n, m; cin >> r >> n >> m; double d[int(1e6)] = {0}; double x = n / 2; FOR (i, 1, n) { double length = 2 * sqrt((1 - pow((abs(x - i) / x), 2)) * pow(r, 2)); d[int(m + i)] = length; } double ans = 0; REP (i, 1e6 - m) { ans += max(d[i], d[int(i + m)]); } printf("%.16lf\n", ans); }
Submission Info
Submission Time | |
---|---|
Task | B - ステップカット |
User | croonalullaby |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 686 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 8064 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 | 6 ms | 8064 KB |
00_example_02.txt | AC | 6 ms | 8064 KB |
00_example_03.txt | AC | 6 ms | 8064 KB |
10_rand_01.txt | AC | 5 ms | 8064 KB |
10_rand_02.txt | AC | 5 ms | 8064 KB |
10_rand_03.txt | AC | 6 ms | 8064 KB |
10_rand_04.txt | AC | 6 ms | 8064 KB |
10_rand_05.txt | AC | 6 ms | 8064 KB |
10_rand_06.txt | AC | 5 ms | 8064 KB |
10_rand_07.txt | AC | 5 ms | 8064 KB |
10_rand_08.txt | AC | 6 ms | 8064 KB |
20_hand_01.txt | AC | 6 ms | 8064 KB |
20_hand_02.txt | AC | 6 ms | 8064 KB |
20_hand_03.txt | AC | 6 ms | 8064 KB |
20_hand_04.txt | AC | 6 ms | 8064 KB |
20_hand_05.txt | AC | 6 ms | 8064 KB |