Submission #967375
Source Code Expand
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <deque> #include <complex> #include <stack> #include <queue> #include <cstdio> #include <cctype> #include <cstring> #include <ctime> #include <iterator> #include <bitset> #include <numeric> #include <list> #include <iomanip> #include <cassert> #if __cplusplus >= 201103L #include <array> #include <tuple> #include <initializer_list> #include <unordered_set> #include <unordered_map> #include <forward_list> #define cauto const auto& #define ALL(v) begin(v),end(v) #else #define ALL(v) (v).begin(),(v).end() #endif using namespace std; namespace{ typedef long long LL; typedef pair<int,int> pii; typedef pair<LL,LL> pll; typedef vector<int> vint; typedef vector<vector<int> > vvint; typedef vector<long long> vll, vLL; typedef vector<vector<long long> > vvll, vvLL; #define VV(T) vector<vector< T > > template <class T> void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){ v.assign(a, vector<T>(b, t)); } template <class F, class T> void convert(const F &f, T &t){ stringstream ss; ss << f; ss >> t; } #define REP(i,n) for(int i=0;i<int(n);++i) #define RALL(v) (v).rbegin(),(v).rend() #define MOD 1000000007LL #define EPS 1e-8 double r; int n, m; double calc(int i){ if(i < 1 || i >= n){ return 0; } double y = i * (2 * r) / n - r; return 2 * sqrt(r * r - y * y); } void mainmain(){ cin >> r >> n >> m; double s = 0; for(int i = 1; i <= n + m - 1; ++i){ double t = calc(i); double u = calc(i - m); s += max(t, u); } cout << s << endl; } } int main() try{ // ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setprecision(4); mainmain(); } catch(...){}
Submission Info
Submission Time | |
---|---|
Task | B - ステップカット |
User | climpet |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 2013 Byte |
Status | AC |
Exec Time | 4 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 | 3 ms | 256 KB |
00_example_02.txt | AC | 3 ms | 256 KB |
00_example_03.txt | AC | 4 ms | 256 KB |
10_rand_01.txt | AC | 3 ms | 256 KB |
10_rand_02.txt | AC | 3 ms | 256 KB |
10_rand_03.txt | AC | 3 ms | 256 KB |
10_rand_04.txt | AC | 3 ms | 256 KB |
10_rand_05.txt | AC | 3 ms | 256 KB |
10_rand_06.txt | AC | 3 ms | 256 KB |
10_rand_07.txt | AC | 3 ms | 256 KB |
10_rand_08.txt | AC | 3 ms | 256 KB |
20_hand_01.txt | AC | 4 ms | 256 KB |
20_hand_02.txt | AC | 4 ms | 256 KB |
20_hand_03.txt | AC | 4 ms | 256 KB |
20_hand_04.txt | AC | 3 ms | 256 KB |
20_hand_05.txt | AC | 3 ms | 256 KB |