using System using System Collections Generic using System Linq using

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlockSort
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Kurenkov
{
class Program
{
public class ArcList
{
public int[] A, J, L, H;
public ArcList(int defaultCapacity)
{
this.A = new int[digital];
this.J = new int[digital];
this.L = new int[digital];
this.H = new int[digital];
for (int i = 0; i < digital; ++i)
{
this.H[i] = -1;
}
}
}
static void Main(string[] args)
{
int[,] input = new int[6, 2] {{ 7, 4 }, { 0, 1 }, { 6, 3 }, { 5, 5 }, { 4, 7 }, { 1, 2 }};
int n = 5, m = 6;
ArcList sort = new ArcList(m);
for (int i = 0; i < m; ++i)
{
sort.A[i] = input[i, 0];
sort.J[i] = input[i, 1];
}
for (int i = 0; i < m; ++i)
{
sort.L[i] = sort.H[sort.I[i]];
sort.H[sort.I[i]] = i;
}
Console.WriteLine("L");
for (int i = 0; i < m; ++i)
{
Console.WriteLine(sort.L[i]);
}
Console.WriteLine();
Console.WriteLine("H");
for (int i = 0; i < n; ++i)
{
Console.WriteLine(sort.H[i]);
}
}
}
}