제출 #1203992

#제출 시각아이디문제언어결과실행 시간메모리
1203992Sir_Ahmed_ImranBroken Device (JOI17_broken_device)C++17
41 / 100
43 ms1592 KiB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define add insert
#define ll long long
#define ld long double
#define terminator main
#define pll pair<ll,ll>
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

void Anna(int n, ll x, int k, int p[]){
    bool a[n];
    for(int i = 0; i < n; i++) a[i] = 1;
    for(int i = 0; i < k; i++) a[p[i]] = 0;
    for(int i = 0; i < n; i++){
        if(a[i] && a[i + 1] && x){
            Set(i, 1);
            Set(i + 1, x & 1);
            x /= 2;
            i++;
        }
        else Set(i, 0);
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define add insert
#define ll long long
#define ld long double
#define terminator main
#define pll pair<ll,ll>
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

ll Bruno(int n, int a[]){
    ll x, p;
    x = 0, p = 1;
    for(int i = 0; i < n; i++){
        if(a[i]){
            x += p * a[i + 1];
            p *= 2;
            i++;
        }
    }
    return x;
}
#Verdict Execution timeMemoryGrader output
Fetching results...