voidfloyd() { memcpy(d, g, sizeof d); for (int k = 0; k < n; k ++ ) for (int i = 0; i < n; i ++ ) for (int j = 0; j < n; j ++ ) d[i][j] |= d[i][k] & d[k][j]; }
intmain() { cin >> n; for (int i = 1; i <= n; i ++ ) { int a, b; cin >> a >> b; g[a][b] = 1; }