Skip to content

Instantly share code, notes, and snippets.

View chaoxu's full-sized avatar
😀

Chao Xu chaoxu

😀
  • University of Electronic Science and Technology of China
  • Chengdu, Sichuan, China
View GitHub Profile
@chaoxu
chaoxu / Contest2011.dyalog
Created August 22, 2011 15:57
Solution for Dyalog competition in 2011
:Namespace Problem1
⎕IO ⎕ML ⎕WX ⎕RL←1 0 0 1093457855
adjacency←{
a←(⍺[;1]⍳⍵) ⍝ edge indexed by numbers
mat←(2⍴(⍴⍺[;1]))⍴0 ⍝ create a empty matrix
mat[↓a⍪⌽a]←1 ⍝ set adjacent edges to 1
mat
}