正文
增加 3 行删除 3 行
35 行未改动36373839404142434445464748495051525354558 行未改动35 行未改动int n; cin >> n;vector <int> a (n + 1); a[0] = 0;for (int i = 1; i <= n; i ++) cin >> a[i];if (n < 10 || n > 13) return cout << "No\n", void ();int cnt = 0;sort (a.begin () + 1, a.end ());if (a[1] != 1) return cout << "No\n", void ();for (int i = 1; i <= n; i ++){if (a[i] == 1) cnt ++;if (a[i] - a[i - 1] > 2 && i != 1 && i != n)return cout << "No\n", void ();}if (cnt < 2) cout << "No\n";else cout << "Yes\n";}8 行未改动35 行未改动36373839404142434445464748495051525354558 行未改动35 行未改动int n; cin >> n;vector <int> a (n + 1); a[0] = 0;for (int i = 1; i <= n; i ++) cin >> a[i];if (n < 10 || n > 13) return cout << "No\n", void ();int cnt = 0;sort (a.begin () + 1, a.end ());if (a[1] != 1) return cout << "No\n", void ();for (int i = 1; i <= n; i ++){if (a[i] == 1) cnt ++;if (a[i] - a[i - 1] > 2 && i != 1 && i != n)return cout << "No\n", void ();}if (cnt < 2) cout << "No\n";else cout << "Yes\n";}8 行未改动