You are viewing a single comment's thread. Return to all comments →
php solution because why not...
$_fp = fopen("php://stdin", "r"); $n = fgets($_fp); $set = explode(' ', fgets($_fp)); $set = array_combine(range(1, count($set)), $set); $involution = true; foreach ($set as $k => $v) { if ($k !== intval($set[$v])) { $involution = false; break; } } echo ($involution ? "YES" : "NO") . PHP_EOL;
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 →
php solution because why not...