>>308
多次元の添字のためのクラス作って、そいつをキーとする HashTable を使うとか。

struct Indeses
{
public int x, y;
public Indeses(int x, int y){this.x = x; this.y=y;}
static bool operator==(Indeses a, Indeses b){return a.x==b.x || x.y==b.y;}
}

HashTable hash = new HashTable()

hash[new Indeses(1, 2)] = 5;

って感じ。
あんまりスマートな方法じゃないけどな。