結果
問題 | No.1551 誕生日の三角形 |
ユーザー | ebi_fly |
提出日時 | 2021-06-18 21:28:48 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 6,084 bytes |
コンパイル時間 | 1,256 ms |
コンパイル使用メモリ | 133,984 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 19:52:55 |
合計ジャッジ時間 | 1,723 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,944 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 2 ms
6,944 KB |
testcase_08 | AC | 2 ms
6,940 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 2 ms
6,940 KB |
ソースコード
#include <iostream> #include <algorithm> #include <utility> #include <string> #include <vector> #include <set> #include <stack> #include <queue> #include <map> #include <math.h> #include <string.h> #include <iomanip> #include <numeric> #include <cstdlib> #include <cstdint> #include <cmath> #include <functional> #include <limits> #include <cassert> #include <bitset> #include <chrono> #include <random> #include <memory> /* macro */ #define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++) #define rrep(i, a, n) for (int i = ((int)(n-1)); i >= (int)(a); i--) #define Rep(i, a, n) for (i64 i = (i64)(a); i< (i64)(n); i++) #define RRep(i, a, n) for (i64 i = ((i64)(n-i64(1))); i>=(i64)(a); i--) #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() /* macro end */ /* template */ namespace ebi { #ifdef LOCAL #define debug(...) \ std::cerr << "LINE: " << __LINE__ << " [" << #__VA_ARGS__ << "]:", \ debug_out(__VA_ARGS__) #else #define debug(...) #endif void debug_out() { std::cerr << std::endl; } template <typename Head, typename... Tail> void debug_out(Head h, Tail... t) { std::cerr << " " << h; if (sizeof...(t) > 0) std::cout << " :"; debug_out(t...); } template <typename T1, typename T2> std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) { return os << pa.first << " " << pa.second; } template <typename T> std::ostream& operator<<(std::ostream& os, std::vector<T> vec) { for (std::size_t i = 0; i < vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : " "); return os; } using size_t = std::size_t; using i64 = long long; using u64 = unsigned long long; template<class T> void fill(std::vector<T> &v) { for(T &e: v) std::cin >> e; } template<class T> struct Edge { int to; T cost; Edge(int to, T cost) : to(to), cost(cost) { } }; template<class T> using Graph = std::vector<std::vector<Edge<T>>>; using graph = std::vector<std::vector<int>>; template <class T> inline bool chmin(T &a, T b) { if (a > b){ a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b){ a = b; return true; } return false; } template <class T> T gcd(T a, T b){ if( b==0 ) return a; else return gcd(b, a%b); } template <class T> T lcm(T a, T b) { return (a*b)/gcd(a,b); } template<class T> T Pow(T x, i64 n) { T res = 1; while(n>0){ if(n&1) res = res *x; x = x*x; n>>=1; } return res; } template<class T> T scan() { T val; std::cin >> val; return val; } constexpr i64 LNF = std::numeric_limits<i64>::max()/4; constexpr int INF = std::numeric_limits<int>::max()/4; const long double PI = acos(-1); const std::vector<int> dy = {1,0,-1,0,1,1,-1,-1}; const std::vector<int> dx = {0,1,0,-1,1,-1,1,-1}; } /* template end */ /* author: noshi91 reference: https://noshi91.hatenablog.com/entry/2019/03/31/174006 noshi91のブログで公開されているmodintを元にinv(), pow()を追加したものです */ #include <cstdint> #include <iostream> namespace ebi { template<std::uint_fast64_t Modulus> class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr u64 &val() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const modint rhs) const noexcept { return modint(*this) -= rhs; } constexpr modint operator*(const modint rhs) const noexcept { return modint(*this) *= rhs; } constexpr modint operator/(const modint rhs) const noexcept { return modint(*this) /= rhs; } constexpr modint &operator+=(const modint rhs) noexcept { a += rhs.a; if (a >= Modulus) { a -= Modulus; } return *this; } constexpr modint &operator-=(const modint rhs) noexcept { if (a < rhs.a) { a += Modulus; } a -= rhs.a; return *this; } constexpr modint &operator*=(const modint rhs) noexcept { a = a * rhs.a % Modulus; return *this; } constexpr modint &operator/=(modint rhs) noexcept { u64 exp = Modulus - 2; while (exp) { if (exp % 2) { *this *= rhs; } rhs *= rhs; exp /= 2; } return *this; } constexpr modint operator-() const { return modint() - *this; } bool operator==(const u64 rhs) { return a == rhs; } bool operator!=(const u64 rhs) { return a != rhs; } constexpr modint& operator++() { a++; if( a == mod() ) a = 0; return *this; } constexpr modint& operator--() { if( a == 0 ) a = mod(); a--; return *this; } modint pow(u64 n) const noexcept { modint res = 1; modint x = a; while(n>0){ if(n&1) res *= x; x *= x; n >>=1; } return res; } modint inv() const { return pow(Modulus-2); } static u64 mod() { return Modulus; } }; using modint998244353 = modint<998244353>; using modint1000000007 = modint<1000000007>; template<std::uint_fast64_t Modulus> std::ostream& operator<<(std::ostream& os, modint<Modulus> a){ return os << a.val(); } } // namespace ebi namespace ebi { using mint = modint998244353; using ld = long double; void main_() { int l; std::cin >> l; long double ans = std::sqrt(3)/ld(36); ans *= l*l; std::cout << ans << std::endl; } } int main() { std::cout << std::fixed << std::setprecision(15); std::cin.tie(nullptr); std::ios::sync_with_stdio(false); ebi::main_(); return 0; }