77852024-01-11 10:03:27TortelliniJrSorozat generáláscsharpWrong answer 6/5075ms26852 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sorozatGen
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int m = inp[0];
            int jel = inp[1];
            int a = inp[2];
            int b = inp[3];
            int lepessz = inp[4];
            int k = inp[5];
            List<int> eddig = new List<int>();
            int mego = -1;
            for (int i = 0; i < lepessz; i++)
            {
                jel = (jel * a + b) / 10 % 100;
                if (eddig.Contains(jel) && mego == -1)
                {
                    mego = i - eddig.FindIndex(element => element.Equals(jel));
                }
                else
                {
                    eddig.Add(jel);
                }
            }
            eddig.Sort();
            Console.WriteLine(mego);
            Console.WriteLine(eddig[k - 1]);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/037ms22336 KiB
2Wrong answer0/075ms24068 KiB
3Partially correct1/237ms22644 KiB
4Partially correct1/237ms23100 KiB
5Partially correct1/235ms23284 KiB
6Partially correct1/235ms23156 KiB
7Accepted2/237ms23676 KiB
8Wrong answer0/437ms23436 KiB
9Wrong answer0/441ms23820 KiB
10Wrong answer0/448ms24320 KiB
11Wrong answer0/452ms24808 KiB
12Wrong answer0/456ms26156 KiB
13Wrong answer0/461ms26536 KiB
14Wrong answer0/464ms26572 KiB
15Wrong answer0/467ms26432 KiB
16Wrong answer0/464ms26640 KiB
17Wrong answer0/459ms26852 KiB