|
|
вернуться в форумWhy This program got WA(1)? #include <iostream.h> int main() { int me[100000][2], m, n, mass[1001], i, t; cin >> n >> m; for (i = 0; i < m; ++i) cin >> me[i][0] >> me[i][1]; for (i = 0; i < n; ++i) { cin >> t; mass[t] = i; } for (i = 0; i < m; ++i) { if (mass[ me[i][0] ] > mass[ me[i][1] ]) {cout << "NO"; return 0;} } cout << "YES"; return 0; } |
|
|