Submission #34405481


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;

namespace Tasks
{
    public class E
    {
        public static void Main()
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = Scanner.Scan<int>();
            var answer = 0.0;
            for (var i = 0; i < N; i++)
            {
                var sum = 0.0;
                for (var j = 1; j <= 6; j++)
                {
                    sum += Math.Max(j, answer) / 6.0;
                }

                answer = Math.Max(answer, sum);
            }

            Console.WriteLine(answer);
        }


        public static class Scanner
        {
            public static string ScanLine() => Console.ReadLine()?.Trim() ?? string.Empty;
            public static string[] Scan() => ScanLine().Split(' ');
            public static T Scan<T>() where T : IConvertible => Convert<T>(Scan()[0]);
            public static (T1, T2) Scan<T1, T2>() where T1 : IConvertible where T2 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]));
            }
            public static (T1, T2, T3) Scan<T1, T2, T3>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]));
            }
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]));
            }
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible where T5 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]), Convert<T5>(line[4]));
            }
            public static (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible where T5 : IConvertible where T6 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]), Convert<T5>(line[4]), Convert<T6>(line[5]));
            }
            public static IEnumerable<T> ScanEnumerable<T>() where T : IConvertible => Scan().Select(Convert<T>);
            private static T Convert<T>(string value) where T : IConvertible => (T)System.Convert.ChangeType(value, typeof(T));
        }
    }
}

Submission Info

Submission Time
Task E - Throwing the Die
User AconCavy
Language C# (.NET Core 3.1.201)
Score 500
Code Size 3175 Byte
Status AC
Exec Time 96 ms
Memory 27544 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 82 ms 27392 KiB
random_02.txt AC 85 ms 27316 KiB
random_03.txt AC 78 ms 27536 KiB
random_04.txt AC 85 ms 27220 KiB
random_05.txt AC 79 ms 27544 KiB
random_06.txt AC 85 ms 27248 KiB
random_07.txt AC 96 ms 27104 KiB
random_08.txt AC 81 ms 27212 KiB
random_09.txt AC 77 ms 27264 KiB
random_10.txt AC 81 ms 27240 KiB
random_11.txt AC 81 ms 27256 KiB
random_12.txt AC 74 ms 27008 KiB
random_13.txt AC 89 ms 26996 KiB
random_14.txt AC 87 ms 27196 KiB
random_15.txt AC 94 ms 27536 KiB
random_16.txt AC 84 ms 26992 KiB
random_17.txt AC 74 ms 27248 KiB
random_18.txt AC 88 ms 27208 KiB
random_19.txt AC 81 ms 27392 KiB
random_20.txt AC 80 ms 27000 KiB
random_21.txt AC 85 ms 27400 KiB
random_22.txt AC 77 ms 27104 KiB
sample_01.txt AC 76 ms 27216 KiB
sample_02.txt AC 81 ms 27220 KiB
sample_03.txt AC 84 ms 27384 KiB