#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <deque>
#include <utility>
#include <bitset>
#include <limits.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef double lf;
typedef unsigned int uint;
typedef long double llf;
typedef pair<int, int> pii;
int N, R;
lf X[105], Y[105];
int main() {
scanf("%d%d", &N, &R);
for(int i = 1; i <= N; i++) scanf("%lf%lf", &X[i], &Y[i]);
X[N + 1] = X[1]; Y[N + 1] = Y[1];
lf res = acos(-1) * 2 * R;
for(int i = 1; i <= N; i++) res += hypot(X[i] - X[i + 1], Y[i] - Y[i + 1]);
printf("%.10f\n", res);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1100 KB |
Output is correct |
2 |
Correct |
0 ms |
1100 KB |
Output is correct |
3 |
Correct |
0 ms |
1100 KB |
Output is correct |
4 |
Correct |
0 ms |
1100 KB |
Output is correct |
5 |
Correct |
0 ms |
1100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |