提交时间:2024-11-21 14:51:46

运行 ID: 35010

#include <bits/stdc++.h> #define int long long using namespace std; int a[105], ra[105], f[105]; signed main() { // freopen("balala.in", "r", stdin); // freopen("balala.out", "w", stdout); int n; scanf("%lld", &n); // if (n <= 10) // { // for (int i = 1; i <= n; i++) // { // scanf("%lld", &a[i]); // } // int res = 1; // for (int c = 0; c < (1 << (n - 1)); c++) // { // printf("%llb\n", c); // for (int i = 1; i <= n; i++) // { // ra[i] = a[i]; // if (i > 1 && (c & (1 << (i - 2)))) // { // ra[i] ^= ra[i - 1]; // } // printf("%lld ", ra[i]); // } // puts(""); // for (int i = 1; i <= n; i++) // { // f[i] = 1; // for (int j = 1; j < i; j++) // { // if (ra[j] < ra[i]) // f[i] = max(f[i], f[j] + 1); // } // res = max(res, f[i]); // } // } // printf("%lld\n", res); // return 0; // } // int lst = 0, ans = 0; // for (int i = 1; i <= n; i++) // { // int x; // scanf("%lld", &x); // if (x > lst || i == 1) // { // lst = x; // ans++; // } // else // { // if ((lst ^ x) > lst) // { // ans++; // } // lst ^= x; // } // } printf("%lld", n - 1); return 0; } /* 4 3 2 1 4 3 6 7 */