using System.Collections;
public static int Profit = 0;
public static int time = 0;
public Hashtable table = new Hashtable();
public void JobSequence(int[, ] arr)
while (time < arr.GetLength(0))
for (int i = 0; i < arr.GetLength(0); i++)
if (arr[i, 2] > max && !table.ContainsKey(arr[i, 0]))
table.Add(arr[i, 0], arr[i, 2]);
public static void Main()
int[, ] arr = new int[, ]{{1, 4, 20}, {2, 1, 10}, {3, 1, 40}, {4, 1, 30}};
Program p = new Program();
Console.WriteLine("Job :{0}, Profit:{1}",j,Profit);