UVA 1620

来源:互联网 发布:unity3d save project 编辑:程序博客网 时间:2024/06/07 02:36
#include <bits/stdc++.h>using namespace std;const int maxn = 5E2 + 10;int inp[maxn], T, n;int main(int argc, char const *argv[]){cin >> T;while (T--){cin >> n;int cnt = 0;for (int i = 0; i < n; i++){cin >> inp[i];for (int j = 0; j < i; j++)if (inp[j] > inp[i])cnt++;}if (!(cnt & 1) || !(n & 1)) cout << "possible" << endl;else cout << "impossible" << endl;}return 0;}


定奇偶 , 找规律

0 0