Submission #00043
ソースコード
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #include <random> #define INF_LL 1e18 #define INF 1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() using namespace std; using ll = long long ; using PII = pair< int , int >; template < typename T> void chmax(T &a, T &b){ a = max(a, b); } template < typename T> void chmin(T &a, T &b){ a = min(a, b); } class Union_find{ private : vector< int > par; vector< int > rank; int n; public : Union_find( int a){ n = a; for ( int i = 0;i < n;i++){ par.push_back(i); rank.push_back(0); } } int find( int x){ if (par[x] == x){ return x; } else { return par[x] = find(par[x]); } } void unite( int x, int y){ x = find(x); y = find(y); if (x == y) return ; if (rank[x] < rank[y]){ par[x] = y; } else { par[y] = x; if (rank[x] == rank[y]) rank[x]++; } } bool same( int x, int y){ return find(x) == find(y); } }; int dx[8] = {-1, 1, 0, 0, 1, 1, -1, -1}; int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1}; int main( void ){ int n; cin >> n; cout << fixed << setprecision(10) << n* sin (M_PI/n) << endl; } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 円周率 |
ユーザー名 | maze1230 |
投稿日時 | 2017-03-30 20:20:05 |
言語 | C++11 |
状態 | Accepted |
得点 | 5 |
ソースコード長 | 1445 Byte |
最大実行時間 | 25 ms |
最大メモリ使用量 | 624 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 5 / 5 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
1.in | AC | 22 ms | 480 KB |
1
|
2.in | AC | 25 ms | 468 KB |
1
|
3.in | AC | 23 ms | 456 KB |
1
|
4.in | AC | 18 ms | 440 KB |
1
|
5.in | AC | 24 ms | 420 KB |
1
|
6.in | AC | 21 ms | 408 KB |
1
|
7.in | AC | 16 ms | 512 KB |
1
|
8.in | AC | 23 ms | 624 KB |
1
|