Submission #7041713
Source Code Expand
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cmath> #include <numeric> #include <set> #include <list> #include <bitset> #include <cstdlib> #include <map> using ll = long long int; using namespace std; int main() { double R; int N, M; cin >> R >> N >> M; double height = 2 * R / N; double ans = 0; for (int i = 0; i <= N + M; i++) { double first, second; double k1 = fabs(R - height * i); double k2 = fabs(R - height * (i - M)); first = sqrt(R * R - k1 * k1) * 2; second = sqrt(R * R - k2 * k2) * 2; if ((i - M) <= 0) { second = 0; } if (N <= i) { first = 0; } ans += max(first, second); } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - ステップカット |
User | hatopoppo3 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 866 Byte |
Status | WA |
Exec Time | 4 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 2 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 | WA | 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 | WA | 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 | WA | 2 ms | 256 KB |
20_hand_02.txt | AC | 4 ms | 256 KB |
20_hand_03.txt | WA | 2 ms | 256 KB |
20_hand_04.txt | AC | 1 ms | 256 KB |
20_hand_05.txt | AC | 1 ms | 256 KB |