Submission #2828551

Source Code Expand

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

// typedef long double Double;
typedef double Double;

Double solve(int n,int m,int d){
    Double r;
    if (d == 0) {
        r = (Double)1.0 / n;
    } else {
        r = (Double)2.0 * (n - d) / n / n;
    }
    return r * (m - 1);
}

int main() {
    int n,m,d; cin >>n>>m>>d;
    Double ans = solve(n,m,d);
    printf("%.10f\n", (double)ans);
    return 0;
}

Submission Info

Submission Time
Task C - Ordinary Beauty
User naoya_t
Language C++14 (GCC 5.4.1)
Score 300
Code Size 433 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_1000000000_180707_0.txt, sample_2_3_1.txt
All 300 / 300 sample_1000000000_180707_0.txt, sample_2_3_1.txt, test_11936238_9_153932.txt, test_138666_2854897_1404.txt, test_1_2_0.txt, test_234679769_107_69508.txt, test_25213539_11160_27040.txt, test_28367_3200917_12993.txt, test_46387542_48_441879.txt, test_50484_560629_534.txt, test_569_56_8.txt, test_77_143_1.txt, test_8180059_850_58.txt
Case Name Status Exec Time Memory
sample_1000000000_180707_0.txt 1 ms 256 KB
sample_2_3_1.txt 1 ms 256 KB
test_11936238_9_153932.txt 1 ms 256 KB
test_138666_2854897_1404.txt 1 ms 256 KB
test_1_2_0.txt 1 ms 256 KB
test_234679769_107_69508.txt 1 ms 256 KB
test_25213539_11160_27040.txt 1 ms 256 KB
test_28367_3200917_12993.txt 1 ms 256 KB
test_46387542_48_441879.txt 1 ms 256 KB
test_50484_560629_534.txt 1 ms 256 KB
test_569_56_8.txt 1 ms 256 KB
test_77_143_1.txt 1 ms 256 KB
test_8180059_850_58.txt 1 ms 256 KB