AtCoder Beginner Contest 004

Submission #3731712

Source codeソースコード

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using static System.Math;
// ReSharper disable MemberCanBeMadeStatic.Local
// ReSharper disable PossibleNullReferenceException
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMember.Local
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable SuggestVarOrType_BuiltInTypes
// ReSharper disable SuggestVarOrType_Elsewhere
// ReSharper disable InvertIf
// ReSharper disable InconsistentNaming
// ReSharper disable ConvertIfStatementToSwitchStatement
// ReSharper disable UseObjectOrCollectionInitializer
#pragma warning disable

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve();
            Console.Read();
        }


        private void Solve()
        {
            var input = cin.StrArray(16);


            for (int i = 3; i >= 0; i--)
            {
                var s = new List<string>();
                for (int j = 3; j >= 0; j--)
                {
                    s.Add(input[i * 4 + j]);
                }

                Console.WriteLine(string.Join(" ", s));
            }
        }



        /// <summary>aとbをスワップする</summary>
        void Swap(ref int a, ref int b)
        {
            var tmp = b;
            b = a;
            a = tmp;
        }

        /// <summary>aとbの最大公約数を求める</summary>
        static long Gcd(long a, long b)
        {
            while (true)
            {
                if (a < b)
                {
                    var a1 = a;
                    a = b;
                    b = a1;
                    continue;
                }

                if (b > 0)
                {
                    var a1 = a;
                    a = b;
                    b = a1 % b;
                    continue;
                }
                return a;
            }
        }

        /// <summary>aとbの最小公約数を求める</summary>
        static long Lcm(long a, long b)
        {
            return a / Gcd(a, b) * b;
        }

    }

#pragma warning disable IDE1006 // 命名スタイル
    public static class cin
#pragma warning restore IDE1006 // 命名スタイル
    {
        private const char _separator = ' ';
        private static readonly Queue<string> _input = new Queue<string>();


        public static string ReadLine => Console.ReadLine();

        public static string Str => Read;
        public static string Read
        {
            get {
                if (_input.Count != 0) return _input.Dequeue();

                // ReSharper disable once PossibleNullReferenceException
                var tmp = Console.ReadLine().Split(_separator);
                foreach (var val in tmp)
                {
                    _input.Enqueue(val);
                }

                return _input.Dequeue();
            }
        }

        public static int Int => int.Parse(Read);

        public static long Long => long.Parse(Read);

        public static double Double => double.Parse(Read);

        public static string[] StrArray(long n)
        {
            var ret = new string[n];
            for (long i = 0; i < n; ++i) ret[i] = Read;
            return ret;
        }

        public static int[] IntArray(long n)
        {
            var ret = new int[n];
            for (long i = 0; i < n; ++i) ret[i] = Int;
            return ret;
        }

        public static long[] LongArray(long n)
        {
            var ret = new long[n];
            for (long i = 0; i < n; ++i) ret[i] = Long;
            return ret;
        }

        static bool TypeEquals<T, U>() => typeof(T) == typeof(U);
        static T ChangeType<T, U>(U a) => (T)System.Convert.ChangeType(a, typeof(T));
        static T Convert<T>(string s) => TypeEquals<T, int>() ? ChangeType<T, int>(int.Parse(s))
            : TypeEquals<T, long>() ? ChangeType<T, long>(long.Parse(s))
            : TypeEquals<T, double>() ? ChangeType<T, double>(double.Parse(s))
            : TypeEquals<T, char>() ? ChangeType<T, char>(s[0])
            : ChangeType<T, string>(s);

        static void Multi<T>(out T a) => a = Convert<T>(Str);
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = StrArray(2); a = Convert<T>(ar[0]); b = Convert<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = StrArray(3); a = Convert<T>(ar[0]); b = Convert<U>(ar[1]); c = Convert<V>(ar[2]);
        }
    }
}

Submission

Task問題 B - 回転
User nameユーザ名 Kichi_128
Created time投稿日時
Language言語 C# (Mono 4.6.2.0)
Status状態 AC
Score得点 100
Source lengthソースコード長 4791 Byte
File nameファイル名
Exec time実行時間 25 ms
Memory usageメモリ使用量 13396 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 00_sample_00.txt,00_sample_01.txt,01_all_dot.txt,02_all_o.txt,03_all_x.txt,rand_0.txt,rand_1.txt,rand_10.txt,rand_11.txt,rand_12.txt,rand_13.txt,rand_14.txt,rand_15.txt,rand_16.txt,rand_17.txt,rand_18.txt,rand_19.txt,rand_2.txt,rand_20.txt,rand_21.txt,rand_22.txt,rand_23.txt,rand_24.txt,rand_3.txt,rand_4.txt,rand_5.txt,rand_6.txt,rand_7.txt,rand_8.txt,rand_9.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_sample_00.txt AC 24 ms 11220 KB
00_sample_01.txt AC 24 ms 11220 KB
01_all_dot.txt AC 24 ms 11220 KB
02_all_o.txt AC 24 ms 9172 KB
03_all_x.txt AC 25 ms 13268 KB
rand_0.txt AC 24 ms 11220 KB
rand_1.txt AC 25 ms 13268 KB
rand_10.txt AC 24 ms 11348 KB
rand_11.txt AC 25 ms 13268 KB
rand_12.txt AC 25 ms 13268 KB
rand_13.txt AC 25 ms 11348 KB
rand_14.txt AC 24 ms 9300 KB
rand_15.txt AC 25 ms 11348 KB
rand_16.txt AC 24 ms 11348 KB
rand_17.txt AC 24 ms 11220 KB
rand_18.txt AC 24 ms 11220 KB
rand_19.txt AC 25 ms 11220 KB
rand_2.txt AC 24 ms 9300 KB
rand_20.txt AC 25 ms 13268 KB
rand_21.txt AC 25 ms 13396 KB
rand_22.txt AC 24 ms 13268 KB
rand_23.txt AC 24 ms 11220 KB
rand_24.txt AC 24 ms 9300 KB
rand_3.txt AC 24 ms 11220 KB
rand_4.txt AC 24 ms 9172 KB
rand_5.txt AC 24 ms 11220 KB
rand_6.txt AC 24 ms 11220 KB
rand_7.txt AC 24 ms 11220 KB
rand_8.txt AC 24 ms 9172 KB
rand_9.txt AC 24 ms 11220 KB