提出 #74071569
ソースコード 拡げる
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, k, n) for (ll i = (ll)(k); i < (ll)(n); i++)
#define repM(i, k, n) for (ll i = (ll)(k); i > (ll)(n); i--)
#define all(v) v.begin(), v.end()
#define sort_rev(v) sort((v).begin(), (v).end(), greater<>())
#define lmax(a, b) max((ll)a, (ll)b)
#define lmin(a, b) min((ll)a, (ll)b)
#define lclamp(x, a, b) clamp((ll)x, (ll)a, (ll)b)
using ll = long long;
const ll mod9 = 998244353;
const ll mod1 = 1000000007;
const ll INF = 9223372036854775807;
vector<ll> dx = {1, -1, 0, 0};
vector<ll> dy = {0, 0, 1, -1};
vector<ll> dx8 = {-1, -1, -1, 0, 1, 1, 1, 0};
vector<ll> dy8 = {-1, 0, 1, 1, 1, 0, -1, -1};
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define mi1 cout << -1 << endl
void YesNo(bool b){
if(b){
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
ll GCD(ll x, ll y){
long long a = x, b = y;
while(a * b != 0){
if(a >= b){
a %= b;
} else {
b %= a;
}
}
return a+b;
}
ll powll(ll a, ll n){
ll ans = 1;
rep(i, n){
ans *= a;
}
return ans;
}
long long modpow(long long n, long long k, long long mod){
long long res = 1;
while(k){
if(k & 1){
res = (res * n) % mod;
}
n = (n * n) % mod;
k >>= 1;
}
return res;
}
struct Eratosthenes {
// テーブル
vector<bool> isprime;
// 整数 i を割り切る最小の素数
vector<ll> minfactor;
// コンストラクタで篩を回す
Eratosthenes(ll N) : isprime(N+1, true),
minfactor(N+1, -1) {
// 1 は予めふるい落としておく
isprime[1] = false;
minfactor[1] = 1;
// 篩
for (ll p = 2; p <= N; ++p) {
// すでに合成数であるものはスキップする
if (!isprime[p]) continue;
// p についての情報更新
minfactor[p] = p;
// p 以外の p の倍数から素数ラベルを剥奪
for (ll q = p * 2; q <= N; q += p) {
// q は合成数なのでふるい落とす
isprime[q] = false;
// q は p で割り切れる旨を更新
if (minfactor[q] == -1) minfactor[q] = p;
}
}
}
// 高速素因数分解
// pair (素因子, 指数) の vector を返す
vector<pair<ll ,ll>> factorize(ll n) {
vector<pair<ll,ll>> res;
while (n > 1) {
ll p = minfactor[n];
ll exp = 0;
// n で割り切れる限り割る
while (minfactor[n] == p) {
n /= p;
++exp;
}
res.emplace_back(p, exp);
}
return res;
}
};
ll vec_sum(vector<ll> A){
ll sum = 0;
for(ll a: A){
sum += a;
}
return sum;
}
vector<ll> isp(10e6, true);
void sieve() {
isp[0] = false;
isp[1] = false;
for (ll i=2; pow(i,2)<=10e6; i++) {
if (isp[i]) for(ll j=2; i*j<=10e6; j++) isp[i*j] = false;
}
}
void vec_cout(vector<ll> A){
for(ll a: A){
cout << a << " ";
}
}
bool grid_in(ll x, ll y, ll weigth, ll heigth){
if(0 <= x && x < weigth && 0 <= y && y < heigth) return true;
return false;
}
vector<vector<ll>> grid_ll_rotate(vector<vector<ll>> A){
vector<vector<ll>> copy = A;
ll N = A.size();
rep(i, N){
rep(k, N){
copy[i][k] = A[k][N-1-i];
}
}
return copy;
}
void grid_ll_cout(vector<vector<ll>> A){
for(vector<ll> v: A){
for(ll a: v){
cout << a << " ";
}
cout << endl;
}
}
vector<string> grid_st_rotate(vector<string> A){
vector<string> copy = A;
ll N = A.size();
rep(i, N){
rep(k, N){
copy[i][k] = A[k][N-1-i];
}
}
return copy;
}
void grid_st_cout(vector<string> A){
for(string v: A){
cout << v << endl;
}
}
ofstream outputfile("test.txt");
void write(string S){
cout << S << endl;
outputfile << S << endl;
}
void cout_fixed(double d){
cout << fixed << setprecision(15) << d;
}
class UnionFind{
public:
ll par[200009];
ll siz[200009];
// N頂点のUnion-Findを作成
void init(ll N){
rep2(i, 1, N+1) par[i] = -1; // 最初は親がない
rep2(i, 1, N+1) siz[i] = 1; // 最初はグループの頂点数が1
}
// 頂点xの根を返す関数
ll root(ll x){
while(true){
if(par[x] == -1) break;
x = par[x];
}
return x;
}
// 要素uとvを統合する関数
void unite(ll u, ll v){
ll RootU = root(u);
ll RootV = root(v);
if(RootU == RootV) return; // uとvが同じグループの時は処理を行わない
if(siz[RootU] < siz[RootV]){
par[RootU] = RootV;
siz[RootV] = siz[RootU] + siz[RootV];
} else {
par[RootV] = RootU;
siz[RootU] = siz[RootU] + siz[RootV];
}
}
// 要素uとvが同一のグループかどうかを返す関数
bool same(ll u, ll v){
if(root(u) == root(v)) return true;
return false;
}
};
// (a/b)%mod -> a*modinv(b, mod)
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, v);
}
u %= m;
if (u < 0) u += m;
return u;
}
# include <math.h>
bool IsPrime(ll num)
{
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
double sqrtNum = sqrt(num);
for (ll i = 3; i <= sqrtNum; i += 2)
{
if (num % i == 0)
{
// 素数ではない
return false;
}
}
// 素数である
return true;
}
ll N;
vector<ll> A(300000);
vector<vector<ll>> G(300000, vector<ll> (0));
vector<bool> visited(300000, false);
vector<ll> ans(300000);
set<ll> S;
ll cnt = 0;
int main(){
double d;
cin >> d;
d /= 2;
cout_fixed(d*d*3.141592653589793);
}
提出情報
| 提出日時 |
|
| 問題 |
A - π |
| ユーザ |
mahi_mahi_ |
| 言語 |
C++23 (GCC 15.2.0) |
| 得点 |
100 |
| コード長 |
6221 Byte |
| 結果 |
AC |
| 実行時間 |
41 ms |
| メモリ |
93668 KiB |
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
100 / 100 |
| 結果 |
|
|
| セット名 |
テストケース |
| Sample |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_00.txt |
AC |
41 ms |
93472 KiB |
| 00_sample_01.txt |
AC |
38 ms |
93588 KiB |
| 00_sample_02.txt |
AC |
39 ms |
93540 KiB |
| 01_random_00.txt |
AC |
39 ms |
93576 KiB |
| 01_random_01.txt |
AC |
38 ms |
93668 KiB |
| 01_random_02.txt |
AC |
37 ms |
93480 KiB |
| 01_random_03.txt |
AC |
37 ms |
93416 KiB |
| 01_random_04.txt |
AC |
37 ms |
93512 KiB |
| 01_random_05.txt |
AC |
38 ms |
93668 KiB |
| 01_random_06.txt |
AC |
38 ms |
93544 KiB |