結果
問題 | No.1033 乱数サイ |
ユーザー |
|
提出日時 | 2020-04-24 22:15:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 1,489 ms |
コンパイル使用メモリ | 167,324 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 03:00:33 |
合計ジャッジ時間 | 2,084 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i, s, e) for (ll i = s; i < e; ++i)#define sort_(a) sort(a.begin(), a.end())#define rsort(a) sort(a.rbegin(), a.rend())#define sum(a) accumulate(a.begin(), a.end(), 0LL)#define __lcm(a, b) std::__detail::__lcm(a, b)typedef long long unsigned int ll;const long mod = 1e9 + 7;int main(void) {#ifdef DEBUGfreopen("input.txt", "r", stdin);#endifios_base::sync_with_stdio(false);cin.tie(0);ll N, K;cin >> N >> K;ll deno = (N + 1) * K;ll nume = 0;rep(i, 0, N + 1) {nume += i * K;}double ans = (double)nume / deno;printf("%.10f\n", ans);return 0;}