제출 #739063

#제출 시각아이디문제언어결과실행 시간메모리
739063AverageAmogusEnjoyerLongest beautiful sequence (IZhO17_subsequence)C++17
0 / 100
1 ms340 KiB
/* ID: dalpone1 TASK: Longest_Beautiful_Sequence LANG: C++ */ #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define pb push_back #define ll long long #define nl '\n' const int N = 100100, K = 21; int dp[N][K], n, a[N], k[N], ans; unordered_map<int, int> lastpos, fakepos; int main() { // ifstream cin(".in"); // ofstream cout(".out"); ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> k[i]; for (int i = 0; i < n; i++) for (int j = 0; j < i; j++) { ans++; ans %= 10; } cout << ans; // lastpos[a[0]] = 0; // // fakepos[~a[0]] = 0; // for (int i = 1; i < n; i++) { // int cnt = __builtin_popcount(a[i]); // for (int j = 0; j < K; j++) { // if ((a[i] & (1 << j)) == 0) continue; // if (lastpos.count(a[i] ^ (1 << j)) == 0) continue; // dp[i][j] = max(dp[i][j], 1 + dp[lastpos[a[i] ^ (1 << j)]][cnt-1]); // } // lastpos[a[i]] = i; // // fakepos[~a[i]] = i; // } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...