77822024-01-11 09:56:17TortelliniJrSorozat generáláscsharpWrong answer 5/5032ms25560 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 = 0;
            for (int i = 0; i < lepessz; i++)
            {
                jel = (jel * a + b) / 10 % 100;
                if (eddig.Contains(jel))
                {
                    int f = eddig.FindIndex(element => element.Equals(jel));
                    mego = i - eddig.FindIndex(element => element.Equals(jel));
                    break;
                }
                else
                {
                    eddig.Add(jel);
                }
            }
            Console.WriteLine(mego);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base5/50
1Wrong answer0/032ms22192 KiB
2Wrong answer0/032ms22584 KiB
3Partially correct1/232ms22904 KiB
4Partially correct1/232ms22972 KiB
5Partially correct1/232ms22884 KiB
6Partially correct1/232ms23600 KiB
7Partially correct1/232ms23568 KiB
8Wrong answer0/432ms23772 KiB
9Wrong answer0/432ms24028 KiB
10Wrong answer0/432ms24224 KiB
11Wrong answer0/432ms24908 KiB
12Wrong answer0/432ms24668 KiB
13Wrong answer0/432ms25012 KiB
14Wrong answer0/432ms25032 KiB
15Wrong answer0/432ms25212 KiB
16Wrong answer0/432ms25260 KiB
17Wrong answer0/432ms25560 KiB