Submission #7736098


Source Code Expand

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

using i64 = int64_t;

int main(){
    int n;
    cin >> n;
    if(n%2){
        printf("%.8lf\n", (n/2+1)/(double)n);
    }else{
        cout << 0.5 << endl;
    }

    return 0;
}

Submission Info

Submission Time
Task A - Odds of Oddness
User nicklaw296
Language C++14 (GCC 5.4.1)
Score 100
Code Size 243 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