Exemplo n.º 1
0
        //[SolutionMethod]
        public MRotateAnswer First(MRotateSample sample)
        {
            List <List <Int64> > arr = new List <List <Int64> >(sample.matrix);
            Int64 r     = sample.r;
            Int32 Rings = Math.Min(arr.Count, arr[0].Count) / 2;

            for (int j = 0; j < Rings; j++)
            {
                RotateRing2(arr, j, r);
            }
            PrintMatrix(arr);
            MRotateAnswer ans = new MRotateAnswer()
            {
                matrix = arr
            };

            return(ans);
        }
Exemplo n.º 2
0
        public TAnswer Second(TSample Sample)

        {
            MRotateSample sample = Sample as MRotateSample;

            List <List <Int64> > arr = new List <List <Int64> >(sample.matrix);
            Int32 r     = sample.r;
            Int32 Rings = Math.Min(arr.Count, arr[0].Count) / 2;

            for (int j = 0; j < Rings; j++)
            {
                RotateRing3(arr, j, r);
            }
            MRotateAnswer ans = new MRotateAnswer()
            {
                matrix = arr
            };

            return(ans);
        }