| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 133861 | Kastanda | Longest beautiful sequence (IZhO17_subsequence) | C++11 | 4378 ms | 79624 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// ItnoE
#include<bits/stdc++.h>
using namespace std;
const int N = 100005, SQ = 1024;
int n, A[N], P[N];
pair < int , int > dp[21][SQ][SQ];
inline void Max(pair < int , int > &a, pair < int , int > b) {a = max(a, b);}
int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i ++)
        scanf("%d", &A[i]);
    int Mx = 0, Bi = 0;
    for (int i = 1; i <= n; i ++)
    {
        int k, a = A[i];
        scanf("%d", &k);
        pair < int , int > Bst = {0, 0};
        if (__builtin_popcount(a) >= k)
            for (int j = 0; j < SQ; j ++)
                if (k >= __builtin_popcount(a >> 10 & j))
                    Max(Bst, dp[k - __builtin_popcount(a >> 10 & j)][j][a & 1023]);
        P[i] = Bst.second; Bst.first ++; Bst.second = i;
        for (int j = 0; j < SQ; j ++)
            Max(dp[__builtin_popcount(a & j)][a >> 10][j], Bst);
        if (Bst.first > Mx)
            Mx = Bst.first, Bi = i;
    }
    vector < int > R;
    while (Bi)
        R.push_back(Bi), Bi = P[Bi];
    reverse(R.begin(), R.end());
    printf("%d\n", (int)R.size());
    for (int v : R)
        printf("%d ", v);
    return 0;
}
컴파일 시 표준 에러 (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... | ||||
