Submission #00027
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #define rep(i,s,n) for(int i = (s); (n) > i; i++) #define REP(i,n) rep(i,0,n) #define RANGE(x,a,b) ((a) <= (x) && (x) <= (b)) #define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b)) #define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d)) #define PW(x) ((x)*(x)) #define ALL(x) (x).begin(), (x).end() #define RALL(x) (x).rbegin(), (x).rend() #define MODU 1000000007 #define bitcheck(a,b) ((a >> b) & 1) #define bitset(a,b) ( a |= (1 << b)) #define bitunset(a,b) (a &= ~(1 << b)) #define MP(a,b) make_pair((a),(b)) #define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second)) #define pritnf printf #define scnaf scanf #define itn int #define PI 3.141592653589 #define izryt bool using namespace std; typedef long long ll; typedef pair< int , int > pii; typedef pair<ll, ll> pll; template < typename A, size_t N, typename T> void Fill(A(&array)[N], const T &val) { std::fill((T*)array, (T*)(array + N), val); } pii Dir[8] = { //移動 { 0 ,1 },{ -1 ,0 },{ 1 ,0 },{ 0 ,-1 }, { 1 ,1 },{ 1 ,-1 },{ -1 ,1 },{ -1 ,-1 } }; signed main() { double a; scanf ( "%lf" , &a); double rad = (360 / a) * PI /180; printf ( "%lf\n" , sqrt (2-2* cos (rad)) * a/2); return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 円周率 |
ユーザー名 | もやし |
投稿日時 | 2017-03-30 20:10:35 |
言語 | C++11 |
状態 | Accepted |
得点 | 5 |
ソースコード長 | 1583 Byte |
最大実行時間 | 24 ms |
最大メモリ使用量 | 672 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 5 / 5 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
1.in | AC | 18 ms | 476 KB |
1
|
2.in | AC | 21 ms | 460 KB |
1
|
3.in | AC | 22 ms | 568 KB |
1
|
4.in | AC | 24 ms | 672 KB |
1
|
5.in | AC | 20 ms | 528 KB |
1
|
6.in | AC | 18 ms | 516 KB |
1
|
7.in | AC | 14 ms | 504 KB |
1
|
8.in | AC | 21 ms | 352 KB |
1
|