标签:
原题:
Description
Input
Output
Sample Input
Sample Output
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> using namespace std; int main() { int t; cin >> t; while (t--){ __int64 n; cin >> n; __int64 ans = 0; if (n % 2 == 0){ if (n == 2) ans = 1; else{ if ((n / 2) % 2 == 0){ ans = (((n / 2) - 1)* (n / 2 + 1)); } else{ ans = (((n / 2) - 2)* (n / 2 + 2)); } } } else{ ans = (n / 2 * ((n / 2) + 1)); } cout << ans << endl; } return 0; }
HDU 4627 The Unsolvable Problem 解题心得
标签:
原文地址:http://www.cnblogs.com/shawn-ji/p/4656870.html