Submission #5236344
Source Code Expand
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
void add(ll& a, ll b){a = (a+b) % MOD;}
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
double r,k,ans=0;
int n,m;
double calc(int x){
if(x<=0 && x>=n) return 0;
k=fabs(r-2*r/n*x);
return sqrt(r*r-k*k)*2;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
cin>>r>>n>>m;
REP(i,n+m){
ans+=max(calc(i),calc(i-m));
}
printf("%.8lf\n",ans);
}
Submission Info
Submission Time |
|
Task |
B - ステップカット |
User |
Bondo416 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1110 Byte |
Status |
WA |
Exec Time |
5 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 |
WA |
1 ms |
256 KB |
00_example_03.txt |
WA |
3 ms |
256 KB |
10_rand_01.txt |
WA |
1 ms |
256 KB |
10_rand_02.txt |
WA |
1 ms |
256 KB |
10_rand_03.txt |
WA |
2 ms |
256 KB |
10_rand_04.txt |
WA |
1 ms |
256 KB |
10_rand_05.txt |
WA |
1 ms |
256 KB |
10_rand_06.txt |
WA |
1 ms |
256 KB |
10_rand_07.txt |
WA |
2 ms |
256 KB |
10_rand_08.txt |
WA |
2 ms |
256 KB |
20_hand_01.txt |
AC |
3 ms |
256 KB |
20_hand_02.txt |
WA |
5 ms |
256 KB |
20_hand_03.txt |
AC |
3 ms |
256 KB |
20_hand_04.txt |
WA |
1 ms |
256 KB |
20_hand_05.txt |
AC |
1 ms |
256 KB |