hdoj:2049
摘要:部分错排 http://acm.hdu.edu.cn/showproblem.php?pid=2049
阅读全文
hdoj:2048
摘要:1--n 第一个位置是2--n,n-1种 第二个位置是1,剩余数排列 a(n-2) 第二个位置不是1,剩余数排列a(n-1) a(n) = (n-1)*(a(n-2) + a(n-1)) http://acm.hdu.edu.cn/showproblem.php?pid=2048
阅读全文
hdoj:2047
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2047
阅读全文
hdoj:2046
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2046
阅读全文
hdoj:2045
摘要:#include using namespace std; long long a[51]; int main() { int n; a[1] = 3; a[2] = 6; a[3] = 6; for (int i = 4; i > n) { cout << a[n] << endl; } }
阅读全文
hdoj:2044
摘要:#include using namespace std; long long fib(int n) { long long f0 = 1; long long f1 = 1; if (n = 2) { long long f2 = f0 + f1; f0 = f1; f1 = f2; n--; ...
阅读全文
hdoj:2043
摘要:#include #include using namespace std; bool judgeSize(string str) { int size = str.size(); if (size 16) return false; return true; } int isA(string str) { for (auto &c : ...
阅读全文
hdoj:2042
摘要:a(n) = 2*a(n-1) -2 a(n) -2 = 2*{a(n-1) -2} a(n) = 2^n + 2
阅读全文
hdoj:2040
摘要:#include #include using namespace std; vector yueShu(long a) { vector vec; vec.push_back(1); for (int i = 2; i v) { long s = 0; for (int vi : v) { s += vi; } ...
阅读全文
hdoj:2037
摘要:#include using namespace std; struct Time { int start; int end; }; Time times[101]; int dp[101]; void sortTimes(Time times[], int n) { // 直接插入排序 for (int i = 1; i = 1 && times[j]....
阅读全文
hdoj:2036
摘要:#include using namespace std; struct Point { int x, y; }; Point a[101]; int main() { int n; while (cin >> n && n != 0) { for (int i = 1; i > a[i].x >> a[i].y; } ...
阅读全文
hdoj:2035
摘要:#include using namespace std; int main() { long a, b; while (cin >> a >> b && a != 0 && b != 0) { long result = a; for (long i = 2; i <= b; i++) { ...
阅读全文
hdoj:2033
摘要:#include #include using namespace std; int main() { int n; int h, m, s; int AH, AM, AS, BH, BM, BS; int flag = 0; cin >> n; while (n--) { cin >> AH >> AM >...
阅读全文
hdoj:2032
摘要:#include #include using namespace std; int main() { int n; int a[31][31]; for (int i = 1; i > n) { for (int i = 1; i <= n; i++) { for (int j = 1; j < i;...
阅读全文
hdoj:2031
摘要:#include #include using namespace std; int main() { int N,R; string a("0123456789ABCDEFG"); while (cin >> N >> R) { string s=""; bool flag = true; if (N 0) ...
阅读全文
hdoj:2029
摘要:#include #include using namespace std; bool isPalindromes(string s) { int len = s.size(); int l = 0, r = len - 1; while (l > n) { string s; for (int i = 1; i > s; ...
阅读全文
hdoj:2028
摘要:#include using namespace std; int main() { int n, i; int a[100]; while (cin >> n) { int max; cin >> a[0]; max = a[0]; for (i = 1; i> a[i]; ...
阅读全文
hdoj:2027
摘要:#include #include #include using namespace std; int main() { int n; cin >> n; string t; getline(cin, t); while (n >= 1) { string s; int a = 0, e = 0, i = ...
阅读全文
hdoj:2023
摘要:#include #include #include double a[51][6],b[51],c[6]; using namespace std; int main() { int n, m; int count = 0; while (cin >> n >> m) { count = 0; for (i...
阅读全文