# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746208 | PVSekhar | Longest beautiful sequence (IZhO17_subsequence) | C++14 | 113 ms | 262144 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>
using namespace std;
#define ll long long
const ll MOD = 1e9+7;
const ll N=(1<<10);
int a[21],k[21];
int dp[N][N][11]; //prev right,cur left half,extra k to match cur left half
int ind[N][N][11]; //ind used to reach this state
int bc[N][N]; //bit count
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
for(int i=0;i<N;i++)for(int j=0;j<N;j++)for(int k=0;k<21;k++)dp[i][j][k]=0;
for(int i=0;i<N;i++)for(int j=0;j<N;j++)for(int k=0;k<21;k++)ind[i][j][k]=-1;
for(int i=0;i<N;i++)for(int j=0;j<N;j++)bc[i][j]=__builtin_popcount(i&j);
int n;
cin>>n;
for (int i = 0; i < n; i++)cin>>a[i];
for (int i = 0; i < n; i++)cin>>k[i];
int p[n]; //stores previous index
for(int i=0;i<n;i++)p[i]=i;
int ans=0,ans_i,len,extra;
for (int i = 0; i < n; i++)
Compilation message (stderr)
# | 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... |