标签:int size mil line nbsp type ffffff tor gre
///@author Sycamore, ZJNU ///@date 4/22/2017 #include <iostream> #include <sstream> #include <iomanip> #include <cmath> #include <string> #include <algorithm> #include <numeric> #include <functional> #include <vector> #include <set> #include <list> #include <stack> #include <queue> #include <map> #include <algorithm> #include <cctype> #include<fstream> //#define cin fin //#define cout fout //ifstream fin("in.txt"); //ofstream fout("out.txt"); using namespace std; typedef vector<int> VI; typedef pair<int, int> PII; int main() { ios::sync_with_stdio(false); int T; cin >> T; while (T--) { int k = 0, t = 0; int n; cin >> n; vector<int>s(n); for (auto &e : s)cin >> e; bool fg = true; if (n < 10 || n>13)fg = false; else if (*min_element(s.begin(), s.end()) != 1) { fg = false; } else if (count(s.begin(), s.end(), 1)<2) { fg = false; } else { sort(s.begin(), s.end()); for (int i = 0; i < n - 2; i++) { if (abs(s[i] - s[i + 1]) > 2) { fg = false; break; } } } if (fg)cout << "Yes\n"; else cout << "No\n"; } return 0; }
标签:int size mil line nbsp type ffffff tor gre
原文地址:http://www.cnblogs.com/zjnu/p/7296314.html