Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
aaaaa
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); } static int D(int i, int j, int[] x, int[] y) { if (x[i - 1] == y[j - 1]) return 1; return 0; } static int F(int m, int n, int[] x, int[] y) { if (n == 0) { return m; } else if (m == 0 && n > 0) { return n; } Task<int> first = Task.Factory.StartNew(() => F(m - 1, n, x, y)); Task<int> second = Task.Factory.StartNew(() => F(m, n - 1, x, y)); Task<int> third = Task.Factory.StartNew(() => D(m, n, x, y)); Task<int> fourth = Task.Factory.StartNew(() => F(m - 1, n - 1, x, y)); Task.WaitAll(first, second, third, fourth); return Math.Min(Math.Min(1 + first.Result, 1 + second.Result), third.Result + fourth.Result); } } }
run
|
edit
|
history
|
help
1
game 1.0.3
Problem3 Binary
asdcsadxasxd
4 squares theorem
Creating async methods in C# prior to version 5.0
Remove duplicates in a linked list
GetChange
Abstract class by Derived class reference example
Download a UTF-8 text file, and display the contents.
Shift Example