## Directed Acyclic Graph

Given a directed graph, output YES if it is acyclic, and NO otherwise.### Input

As usual.N ≤ 1000.

### Output

YES or NO.### Sample Input

3 0 1 0 0 0 1 1 0 0

### Sample Output

NO

### Sample Input 2

3 0 1 0 0 0 1 0 0 0

### Sample Output 2

YES

All Submissions

Best Solutions

**Point Value:** 10

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Jun 28, 2013

**Problem Types:**[Show]

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

ultblad1on Jun 10, 2015 - 11:52:35 pm UTC Input clarificationwgma00on Jun 11, 2015 - 1:07:43 am UTC Re: Input clarificationhttp://wcipeg.com/wiki/Graph_theory#Adjacency_matrix

jargonon Jun 11, 2015 - 3:35:39 am UTC Re: Input clarification