Submission #7735718


Source Code Expand

Copy
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)












 
int main(){
    int n;
    cin >> n;
    if(n % 2 == 0){
        printf("%.8lf\n", 1.0 / 2.0);
    }
    else{
        printf("%.8lf\n", (double)(n / 2 + 1) / (double)(n));
    }
}

Submission Info

Submission Time
Task A - Odds of Oddness
User chocobo
Language C++14 (GCC 5.4.1)
Score 100
Code Size 797 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample00, sample01, sample02
All handmade03, handmade04, handmade05, handmade06, handmade07, handmade08, handmade09, handmade10, handmade11, handmade12, handmade13, handmade14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 AC 1 ms 256 KB
handmade04 AC 1 ms 256 KB
handmade05 AC 1 ms 256 KB
handmade06 AC 1 ms 256 KB
handmade07 AC 1 ms 256 KB
handmade08 AC 1 ms 256 KB
handmade09 AC 1 ms 256 KB
handmade10 AC 1 ms 256 KB
handmade11 AC 1 ms 256 KB
handmade12 AC 1 ms 256 KB
handmade13 AC 1 ms 256 KB
handmade14 AC 1 ms 256 KB
sample00 AC 1 ms 256 KB
sample01 AC 1 ms 256 KB
sample02 AC 1 ms 256 KB