# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
763936 | Alora | Longest beautiful sequence (IZhO17_subsequence) | C++17 | 648 ms | 5648 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define name "cownav"
#define fi(i,a,b) for(int i = a; i <= b; i++)
#define fid(i,a,b) for(int i = a; i >= b; i--)
#define ll long long
#define f first
#define se second
#define pii pair<int, int>
#define getbit(i, j) ((i >> j) & 1)
#define pb push_back
#define all(v) v.begin(), v.end()
#define maxn 100005
const int M = 1e9 + 7;
using namespace std;
int n, a[maxn], k[maxn], res, sl;
pii L[maxn];
int ans[maxn];
void sub2(){
fi(i, 2, n)
fi(j, 1, i - 1) if(__builtin_popcount(a[i] & a[j]) == k[i]){
L[i] = max(L[i], {L[j].f + 1, j});
res = max(res, L[i].f);
}
fi(i, 1, n) if(L[i].f == res){
cout << L[i].f + 1 << '\n';
int sl = 0;
int x = i;
while(x != 0){
ans[++sl] = x;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |