Submission #2865351


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair


typedef long double LD;

LD solve(int n){
    LD mu = ((LD)n + 1)/2;
    LD x = 1.0;
    for (int i=1; i<n; ++i) {
        x = 1.0 + (LD)i/n * x;
    }
    return x * mu;
}

int main() {
    int n; cin >> n;
    printf("%.14Lf\n", solve(n));
    return 0;
}

Submission Info

Submission Time
Task E - デフレゲーム
User naoya_t
Language C++14 (GCC 5.4.1)
Score 500
Code Size 1493 Byte
Status
Exec Time 4 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt
Subtask1 60 / 60 sample_01.txt, sample_02.txt, subtask1_in1.txt, subtask1_in2.txt, subtask1_in3.txt, subtask1_in4.txt
Subtask2 120 / 120 sample_01.txt, sample_02.txt, subtask1_in1.txt, subtask1_in2.txt, subtask1_in3.txt, subtask1_in4.txt, subtask2_in1.txt, subtask2_in2.txt, subtask2_in3.txt, subtask2_in4.txt, subtask2_in5.txt, subtask2_in6.txt
Subtask3 320 / 320 sample_01.txt, sample_02.txt, subtask1_in1.txt, subtask1_in2.txt, subtask1_in3.txt, subtask1_in4.txt, subtask2_in1.txt, subtask2_in2.txt, subtask2_in3.txt, subtask2_in4.txt, subtask2_in5.txt, subtask2_in6.txt, subtask3_in1.txt, subtask3_in10.txt, subtask3_in11.txt, subtask3_in12.txt, subtask3_in13.txt, subtask3_in14.txt, subtask3_in15.txt, subtask3_in16.txt, subtask3_in17.txt, subtask3_in18.txt, subtask3_in19.txt, subtask3_in2.txt, subtask3_in20.txt, subtask3_in21.txt, subtask3_in22.txt, subtask3_in23.txt, subtask3_in24.txt, subtask3_in25.txt, subtask3_in26.txt, subtask3_in27.txt, subtask3_in28.txt, subtask3_in29.txt, subtask3_in3.txt, subtask3_in30.txt, subtask3_in4.txt, subtask3_in5.txt, subtask3_in6.txt, subtask3_in7.txt, subtask3_in8.txt, subtask3_in9.txt
Case Name Status Exec Time Memory
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
subtask1_in1.txt 1 ms 256 KB
subtask1_in2.txt 1 ms 256 KB
subtask1_in3.txt 1 ms 256 KB
subtask1_in4.txt 1 ms 256 KB
subtask2_in1.txt 1 ms 256 KB
subtask2_in2.txt 1 ms 256 KB
subtask2_in3.txt 1 ms 256 KB
subtask2_in4.txt 1 ms 256 KB
subtask2_in5.txt 1 ms 256 KB
subtask2_in6.txt 1 ms 256 KB
subtask3_in1.txt 1 ms 256 KB
subtask3_in10.txt 2 ms 256 KB
subtask3_in11.txt 2 ms 256 KB
subtask3_in12.txt 2 ms 256 KB
subtask3_in13.txt 2 ms 256 KB
subtask3_in14.txt 2 ms 256 KB
subtask3_in15.txt 2 ms 256 KB
subtask3_in16.txt 3 ms 256 KB
subtask3_in17.txt 3 ms 256 KB
subtask3_in18.txt 3 ms 256 KB
subtask3_in19.txt 3 ms 256 KB
subtask3_in2.txt 1 ms 256 KB
subtask3_in20.txt 3 ms 256 KB
subtask3_in21.txt 3 ms 256 KB
subtask3_in22.txt 3 ms 256 KB
subtask3_in23.txt 3 ms 256 KB
subtask3_in24.txt 4 ms 256 KB
subtask3_in25.txt 4 ms 256 KB
subtask3_in26.txt 4 ms 256 KB
subtask3_in27.txt 4 ms 256 KB
subtask3_in28.txt 4 ms 256 KB
subtask3_in29.txt 4 ms 256 KB
subtask3_in3.txt 1 ms 256 KB
subtask3_in30.txt 4 ms 256 KB
subtask3_in4.txt 1 ms 256 KB
subtask3_in5.txt 1 ms 256 KB
subtask3_in6.txt 1 ms 256 KB
subtask3_in7.txt 1 ms 256 KB
subtask3_in8.txt 1 ms 256 KB
subtask3_in9.txt 2 ms 256 KB