Submission #49415893


Source Code Expand

// LUOGU_RID: 143450972
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;

int main() {
	int n;
	cin >> n;
	double ans = 3.5;
	for(int i = 1; i < n; ++i) {
		double tot = 0;
		for(int d = 1; d <= 6; ++d)
			tot += max(ans, 1.0 * d) / 6;
		ans = tot;
	}
	cout << fixed << setprecision(6) << ans;
	return 0;
}

Submission Info

Submission Time
Task E - Throwing the Die
User TigerTanWQY
Language C++ 17 (gcc 12.2)
Score 500
Code Size 355 Byte
Status AC
Exec Time 1 ms
Memory 3816 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 3
AC × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 1 ms 3780 KiB
random_02.txt AC 1 ms 3660 KiB
random_03.txt AC 1 ms 3784 KiB
random_04.txt AC 1 ms 3816 KiB
random_05.txt AC 1 ms 3740 KiB
random_06.txt AC 1 ms 3780 KiB
random_07.txt AC 1 ms 3736 KiB
random_08.txt AC 1 ms 3660 KiB
random_09.txt AC 1 ms 3664 KiB
random_10.txt AC 1 ms 3716 KiB
random_11.txt AC 1 ms 3660 KiB
random_12.txt AC 1 ms 3736 KiB
random_13.txt AC 1 ms 3724 KiB
random_14.txt AC 1 ms 3780 KiB
random_15.txt AC 1 ms 3672 KiB
random_16.txt AC 1 ms 3704 KiB
random_17.txt AC 1 ms 3780 KiB
random_18.txt AC 1 ms 3724 KiB
random_19.txt AC 1 ms 3788 KiB
random_20.txt AC 1 ms 3740 KiB
random_21.txt AC 1 ms 3784 KiB
random_22.txt AC 1 ms 3732 KiB
sample_01.txt AC 1 ms 3708 KiB
sample_02.txt AC 1 ms 3788 KiB
sample_03.txt AC 1 ms 3748 KiB