提出 #4876314
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
using VS = vector<string>; using LL = long long;
using VI = vector<int>; using VVI = vector<VI>;
using PII = pair<int, int>; using PLL = pair<LL, LL>;
using VL = vector<LL>; using VVL = vector<VL>;
#define ALL(a) begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3")
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x)
#endif
const int INF = 1e9; const LL LINF = 1e16;
const LL MOD = 1000000007; const double PI = acos(-1.0);
/* ----- 2019/04/07 Problem: ABC 028 D / Link: http://abc028.contest.atcoder.jp/tasks/abc028_d ----- */
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
double N, K; cin >> N >> K;
double ans = ((6 * (K - 1)*(N - K)) + (3 * (N - 1)) + (1)) / (N*N*N);
cout << fixed << setprecision(10) << ans << endl;
return 0;
}
提出情報
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_0.txt, example_1.txt, example_2.txt |
| All | example_0.txt, example_1.txt, example_2.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, handmade_4.txt, handmade_5.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, smallrand_0.txt, smallrand_1.txt, smallrand_2.txt, smallrand_3.txt, smallrand_4.txt, example_0.txt, example_1.txt, example_2.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_0.txt | AC | 2 ms | 256 KiB |
| example_1.txt | AC | 2 ms | 256 KiB |
| example_2.txt | AC | 2 ms | 256 KiB |
| handmade_0.txt | AC | 2 ms | 256 KiB |
| handmade_1.txt | AC | 2 ms | 256 KiB |
| handmade_2.txt | AC | 2 ms | 256 KiB |
| handmade_3.txt | AC | 2 ms | 256 KiB |
| handmade_4.txt | AC | 2 ms | 256 KiB |
| handmade_5.txt | AC | 2 ms | 256 KiB |
| random_0.txt | AC | 2 ms | 256 KiB |
| random_1.txt | AC | 2 ms | 256 KiB |
| random_2.txt | AC | 2 ms | 256 KiB |
| random_3.txt | AC | 2 ms | 256 KiB |
| random_4.txt | AC | 2 ms | 256 KiB |
| smallrand_0.txt | AC | 2 ms | 256 KiB |
| smallrand_1.txt | AC | 2 ms | 256 KiB |
| smallrand_2.txt | AC | 2 ms | 256 KiB |
| smallrand_3.txt | AC | 2 ms | 256 KiB |
| smallrand_4.txt | AC | 2 ms | 256 KiB |