답안 #400309

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
400309 2021-05-07T20:42:13 Z duality Broken Device (JOI17_broken_device) C++11
41 / 100
54 ms 2792 KB
#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#include "Annalib.h"

void Anna(int N,long long int X,int K,int P[]) {
    int i,c = 0;
    int bad[150];
    for (i = 0; i < N; i++) bad[i] = 0;
    for (i = 0; i < K; i++) bad[P[i]] = 1;
    i = 0;
    while (i < N) {
        if ((i+1 < N) && !bad[i] && !bad[i+1]) {
            Set(i,1);
            if (X & (1LL << c)) Set(i+1,1);
            else Set(i+1,0);
            i += 2,c++;
        }
        else Set(i,0),i++;
    }
}
#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#include "Brunolib.h"

long long int Bruno(int N,int A[]) {
    int i = 0,c = 0;
    LLI X = 0;
    while (i < N) {
        if ((i+1 < N) && A[i]) {
            if (A[i+1]) X |= (1LL << c);
            i += 2,c++;
        }
        else i++;
    }
    return X;
}

# 결과 실행 시간 메모리 Grader output
1 Partially correct 45 ms 2512 KB Output is partially correct - L* = 15
2 Partially correct 43 ms 2520 KB Output is partially correct - L* = 15
3 Partially correct 40 ms 2512 KB Output is partially correct - L* = 17
4 Partially correct 52 ms 2392 KB Output is partially correct - L* = 16
5 Partially correct 40 ms 2460 KB Output is partially correct - L* = 15
6 Partially correct 41 ms 2544 KB Output is partially correct - L* = 15
7 Partially correct 47 ms 2544 KB Output is partially correct - L* = 18
8 Partially correct 41 ms 2656 KB Output is partially correct - L* = 18
9 Partially correct 40 ms 2412 KB Output is partially correct - L* = 16
10 Partially correct 47 ms 2580 KB Output is partially correct - L* = 16
11 Partially correct 40 ms 2460 KB Output is partially correct - L* = 17
12 Partially correct 47 ms 2540 KB Output is partially correct - L* = 17
13 Partially correct 40 ms 2460 KB Output is partially correct - L* = 15
14 Partially correct 40 ms 2540 KB Output is partially correct - L* = 15
15 Partially correct 40 ms 2536 KB Output is partially correct - L* = 16
16 Partially correct 41 ms 2616 KB Output is partially correct - L* = 15
17 Partially correct 50 ms 2516 KB Output is partially correct - L* = 17
18 Partially correct 40 ms 2432 KB Output is partially correct - L* = 16
19 Partially correct 40 ms 2560 KB Output is partially correct - L* = 18
20 Partially correct 41 ms 2532 KB Output is partially correct - L* = 15
21 Partially correct 40 ms 2540 KB Output is partially correct - L* = 15
22 Partially correct 40 ms 2572 KB Output is partially correct - L* = 15
23 Partially correct 46 ms 2436 KB Output is partially correct - L* = 15
24 Partially correct 40 ms 2500 KB Output is partially correct - L* = 17
25 Partially correct 41 ms 2396 KB Output is partially correct - L* = 15
26 Partially correct 54 ms 2608 KB Output is partially correct - L* = 16
27 Partially correct 41 ms 2792 KB Output is partially correct - L* = 15
28 Partially correct 40 ms 2544 KB Output is partially correct - L* = 16
29 Partially correct 40 ms 2464 KB Output is partially correct - L* = 15
30 Partially correct 51 ms 2452 KB Output is partially correct - L* = 16
31 Partially correct 40 ms 2536 KB Output is partially correct - L* = 15
32 Partially correct 41 ms 2480 KB Output is partially correct - L* = 16
33 Partially correct 40 ms 2524 KB Output is partially correct - L* = 15
34 Partially correct 41 ms 2492 KB Output is partially correct - L* = 16
35 Partially correct 50 ms 2460 KB Output is partially correct - L* = 15
36 Partially correct 41 ms 2496 KB Output is partially correct - L* = 15
37 Partially correct 40 ms 2464 KB Output is partially correct - L* = 16
38 Partially correct 43 ms 2448 KB Output is partially correct - L* = 17
39 Partially correct 41 ms 2532 KB Output is partially correct - L* = 15
40 Partially correct 46 ms 2436 KB Output is partially correct - L* = 15