当前位置: 首页>>代码示例>>C#>>正文


C# Solution.solution方法代码示例

本文整理汇总了C#中Solution.solution方法的典型用法代码示例。如果您正苦于以下问题:C# Solution.solution方法的具体用法?C# Solution.solution怎么用?C# Solution.solution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Solution的用法示例。


在下文中一共展示了Solution.solution方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main()
        {
            var s = new Solution();
            Console.WriteLine(s.solution(
                new[] { 5, 1, 3, 1, 1 },
                new[] { 1, 1, 0, 0, 0 }));
            Console.WriteLine(s.solution(
                new[] { 1, 2, 1, 1, 1 },
                new[] { 0, 1, 0, 0, 0 }));
            Console.WriteLine(s.solution(
                new[] { 1, 2, 4, 3, 5 },
                new[] { 0, 1, 0, 1, 0 }));
            Console.WriteLine(s.solution(
                new[] { 1, 2, 1, 3, 1 },
                new[] { 0, 1, 0, 1, 0 }));
            Console.WriteLine(s.solution(
                new[] { 1, 4, 2, 3, 5 },
                new[] { 0, 1, 0, 1, 0 }));
            Console.WriteLine(s.solution(
                new[] { 1, 1, 3, 1, 1 },
                new[] { 0, 1, 0, 0, 0 }));

            Console.WriteLine(s.solution(new[] { 1 }, new[] { 0 }));
            Console.WriteLine(s.solution(new[] { 1 }, new[] { 1 }));

            var A = new int[100000];
            for (int i = 0; i < 100000; i++)
            {
                A[i] = 1000000000 - i;
            }
            var B = new int[100000];
            B[0] = 1;
            Console.WriteLine(s.solution(A, B));
        }
开发者ID:VictorNS,项目名称:Codility,代码行数:34,代码来源:Program.cs

示例2: Main

 static void Main()
 {
     var s = new Solution();
     Console.WriteLine(s.solution(new[] { 2, 1, 1, 2, 3, 1 }));
     Console.WriteLine(s.solution(new int[0]));
     Console.WriteLine(s.solution(new int[100000]));
     var ints = new int[100000];
     ints[0] = 1;
     ints[99999] = 2;
     Console.WriteLine(s.solution(ints));
 }
开发者ID:VictorNS,项目名称:Codility,代码行数:11,代码来源:Program.cs

示例3: Main

    static void Main(string[] args)
    {
        Solution s = new Solution();

        int[] TestCase = new int[6] {1,3,6,4,1,2};
        Console.WriteLine(s.solution(TestCase));
    }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:7,代码来源:Lesson2-3.cs

示例4: Main

    static void Main(string[] args)
    {
        Solution s = new Solution();

        int[] TestCase = new int[4] {2,3,1,5};
        Console.WriteLine(s.solution(TestCase));
    }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:7,代码来源:Lesson1-3.cs

示例5: Main

    static void Main(string[] args)
    {
        Solution s = new Solution();

        int[] TestCase = new int[8] {1,3,1,4,2,3,5,4};
        Console.WriteLine(s.solution(5, TestCase));
    }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:7,代码来源:Lesson2-1.cs

示例6: Main

 static void Main()
 {
     var s = new Solution();
     //var result = s.solution(new int[] { 4, 4, 5, 5, 1 }, new int[] { 3, 2, 4, 3, 1 });
     var result = s.solution(new int[] { 30000 }, new int[] { 30 });
     for (int i = 0; i < result.Length; i++)
     {
         Console.WriteLine(result[i]);
     }
 }
开发者ID:VictorNS,项目名称:Codility,代码行数:10,代码来源:Program.cs

示例7: Main

        static void Main()
        {
            var s = new Solution();
            Console.WriteLine(s.solution(new int[] { 0, 1, 0, 1, 1 }));

            var a1 = new int[10000100];
            for (int i = 100; i < a1.Length; i++)
                a1[i] = 1;
            Console.WriteLine("{0} in array with length: {1}", s.solution(a1), a1.Length);

            var a2 = new int[10000101];
            for (int i = 100; i < a2.Length; i++)
                a2[i] = 1;
            Console.WriteLine("{0} in array with length: {1}", s.solution(a2), a2.Length);

            var a3 = new int[10000000];
            Console.WriteLine("{0} in array with length: {1}", s.solution(a3), a3.Length);

            var a4 = new int[10000000];
            for (int i = 0; i < a4.Length; i++)
                a4[i] = 1;
            Console.WriteLine("{0} in array with length: {1}", s.solution(a4), a4.Length);
        }
开发者ID:VictorNS,项目名称:Codility,代码行数:23,代码来源:Program.cs

示例8: Exec

 private static void Exec(string p1, int[] p2, int[] p3)
 {
     var s = new Solution();
     var re = s.solution(p1, p2, p3);
     Console.WriteLine();
     Console.WriteLine("EXEC " + p1);
     for (int i = 0; i < Math.Min(p2.Length, 10); i++)
         Console.Write(" " + p2[i]);
     Console.WriteLine();
     for (int i = 0; i < Math.Min(p3.Length, 10); i++)
         Console.Write(" " + p3[i]);
     Console.WriteLine();
     Console.Write("Result");
     for (int i = 0; i < Math.Min(re.Length, 10); i++)
         Console.Write(" " + re[i]);
     Console.WriteLine();
 }
开发者ID:VictorNS,项目名称:Codility,代码行数:17,代码来源:Program.cs

示例9: Main

 static void Main(string[] args)
 {
     Solution s = new Solution();
     Console.WriteLine(s.solution(10,85,30));
 }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:5,代码来源:Lesson1-2.cs

示例10: Main

    static void Main(string[] args)
    {
        Solution s = new Solution();

        int[] TestCase = new int[7] {3,4,4,6,1,4,4};
        int[] res = s.solution(5, TestCase);
        for (int i=0; i < res.Length; i++)
        {
            Console.Write("{0} ", res[i]);
        }
        Console.WriteLine();
    }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:12,代码来源:Lesson2-4.cs

示例11: Main

    static void Main(string[] args)
    {
        Solution s = new Solution();

        int[] TestCase1 = new int[4] {4,1,3,2};
        int[] TestCase2 = new int[3] {4,1,3};

        Console.WriteLine(s.solution(TestCase1));
        Console.WriteLine(s.solution(TestCase2));
    }
开发者ID:stanchow,项目名称:Codility-DemoCode,代码行数:10,代码来源:Lesson2-2.cs


注:本文中的Solution.solution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。