You are viewing a single comment's thread. Return to all comments →
In python2
n = input() x = map(int, raw_input().split()) for i in range(0,n): if i+1 != x[x[i]-1]: print 'NO' exit(0) print 'YES'
Seems like cookies are disabled on this browser, please enable them to open this website
Security Involution
You are viewing a single comment's thread. Return to all comments →
In python2