35002023-02-28 13:32:17BenedekOszthatóság 31-gyelcsharpWrong answer 46/5027ms23660 KiB
using System;

public class Program
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        string intermediates = "";
        int num = n;

        while (num > 0)
        {
            string s = num.ToString();
            int len = s.Length;

            if (len > 1)
            {
                int first = int.Parse(s.Substring(0, len - 1));
                int last = int.Parse(s.Substring(len - 1));
                int diff = first - (3 * last);

                if (diff >= 0)
                {
                    num = diff;
                    intermediates += num.ToString() + " " ;
                }
                else
                {
                    break;
                }
            }
            else
            {
                num = 0;
            }
        }

        Console.WriteLine((num % 31 == 0) ? "IGEN" : "NEM");
        Console.WriteLine(intermediates);
    }
}
SubtaskSumTestVerdictTimeMemory
base46/50
1Accepted0/026ms20256 KiB
2Accepted0/027ms20756 KiB
3Accepted3/326ms21028 KiB
4Accepted3/327ms21748 KiB
5Accepted4/426ms21872 KiB
6Accepted4/425ms21820 KiB
7Accepted4/425ms21840 KiB
8Accepted4/425ms21936 KiB
9Accepted4/427ms21976 KiB
10Accepted4/427ms22488 KiB
11Accepted4/426ms23104 KiB
12Wrong answer0/426ms22872 KiB
13Accepted4/425ms23324 KiB
14Accepted4/425ms23380 KiB
15Accepted2/227ms23580 KiB
16Accepted2/226ms23660 KiB