Submission #974339

# Submission time Handle Problem Language Result Execution time Memory
974339 2024-05-03T08:50:10 Z steveonalex Broken Device (JOI17_broken_device) C++17
0 / 100
21 ms 3048 KB
#include <bits/stdc++.h>
#include "Annalib.h"
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define ALL(v) (v).begin(), (v).end()
#define MASK(i) (1LL << (i))
#define GETBIT(mask, i) (((mask) >> (i)) & 1)
 
// mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng(1);
ll rngesus(ll l, ll r){return ((ull) rng()) % (r - l + 1) + l;}
 
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
 
ll LASTBIT(ll mask){return mask & (-mask);}
ll pop_cnt(ll mask){return __builtin_popcountll(mask);}
ll ctz(ll mask){return __builtin_ctzll(mask);}
ll clz(ll mask){return __builtin_clzll(mask);}
ll logOf(ll mask){return 63 - clz(mask);}
 
template <class T1, class T2>
    bool minimize(T1 &a, T2 b){
        if (a > b){a = b; return true;}
        return false;
    }
template <class T1, class T2>
    bool maximize(T1 &a, T2 b){
        if (a < b){a = b; return true;}
        return false;
    }
template <class T>
    void printArr(T& a, string separator = " ", string finish = "\n", ostream& out = cout){
        for(auto i: a) out << i << separator;
        out << finish;
    }
template <class T>
    void remove_dup(vector<T> &a){
        sort(ALL(a));
        a.resize(unique(ALL(a)) - a.begin());
    }

void Anna(int n, ll X, int k, int p[]){

    vector<bool> a(n);
    vector<bool> sigma(n);
    for(int i = 0; i<k; ++i) a[p[i]] = 1;
    int j = 0;
    for(int i = 0; i<60; ++i){
        while(a[j] == 1 || a[j+1] == 1) j++;
        sigma[j] = 1;
        sigma[j+1] = GETBIT(X, i);
        j += 2;
    }
    // printArr(sigma);
    for(int j = 0; j < n; ++j) Set(j, sigma[j]);
}
 
// int main(void){
//     ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

//     int p[] = {0};
//     Anna(150, 69420, 1, p);

//     return 0;
// }
#include <bits/stdc++.h>
#include "Brunolib.h"
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define ALL(v) (v).begin(), (v).end()
#define MASK(i) (1LL << (i))
#define GETBIT(mask, i) (((mask) >> (i)) & 1)
 
// mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng(1);
ll rngesus(ll l, ll r){return ((ull) rng()) % (r - l + 1) + l;}
 
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
 
ll LASTBIT(ll mask){return mask & (-mask);}
ll pop_cnt(ll mask){return __builtin_popcountll(mask);}
ll ctz(ll mask){return __builtin_ctzll(mask);}
ll clz(ll mask){return __builtin_clzll(mask);}
ll logOf(ll mask){return 63 - clz(mask);}
 
template <class T1, class T2>
    bool minimize(T1 &a, T2 b){
        if (a > b){a = b; return true;}
        return false;
    }
template <class T1, class T2>
    bool maximize(T1 &a, T2 b){
        if (a < b){a = b; return true;}
        return false;
    }
template <class T>
    void printArr(T& a, string separator = " ", string finish = "\n", ostream& out = cout){
        for(auto i: a) out << i << separator;
        out << finish;
    }
template <class T>
    void remove_dup(vector<T> &a){
        sort(ALL(a));
        a.resize(unique(ALL(a)) - a.begin());
    }

ll Bruno(int n, int A[]){
    ll X = 0;
    int j = 0;
    for(int i = 0; i<60; ++j){
        while(A[j] == 0) j++;
        if (A[j+1]) X += MASK(i);
        j+=2;
    }
    return X;
}
 
// int main(void){
//     ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);



//     return 0;
// }
# Verdict Execution time Memory Grader output
1 Runtime error 15 ms 2776 KB Execution killed with signal 11
2 Runtime error 19 ms 2772 KB Execution killed with signal 11
3 Runtime error 17 ms 2740 KB Execution killed with signal 11
4 Runtime error 18 ms 2748 KB Execution killed with signal 11
5 Runtime error 15 ms 2740 KB Execution killed with signal 11
6 Runtime error 17 ms 2772 KB Execution killed with signal 11
7 Runtime error 16 ms 2784 KB Execution killed with signal 11
8 Runtime error 16 ms 2772 KB Execution killed with signal 11
9 Runtime error 17 ms 2692 KB Execution killed with signal 11
10 Runtime error 14 ms 2780 KB Execution killed with signal 11
11 Runtime error 14 ms 2676 KB Execution killed with signal 11
12 Runtime error 15 ms 2752 KB Execution killed with signal 11
13 Runtime error 14 ms 2780 KB Execution killed with signal 11
14 Runtime error 16 ms 2704 KB Execution killed with signal 11
15 Runtime error 14 ms 2804 KB Execution killed with signal 11
16 Runtime error 14 ms 2772 KB Execution killed with signal 11
17 Runtime error 14 ms 2772 KB Execution killed with signal 11
18 Runtime error 16 ms 2680 KB Execution killed with signal 11
19 Runtime error 14 ms 2772 KB Execution killed with signal 11
20 Runtime error 15 ms 2752 KB Execution killed with signal 11
21 Runtime error 14 ms 2768 KB Execution killed with signal 11
22 Runtime error 14 ms 2816 KB Execution killed with signal 11
23 Runtime error 15 ms 2848 KB Execution killed with signal 11
24 Runtime error 14 ms 2764 KB Execution killed with signal 11
25 Runtime error 16 ms 2772 KB Execution killed with signal 11
26 Runtime error 21 ms 2704 KB Execution killed with signal 11
27 Runtime error 19 ms 3048 KB Execution killed with signal 11
28 Runtime error 15 ms 2684 KB Execution killed with signal 11
29 Runtime error 14 ms 2772 KB Execution killed with signal 11
30 Runtime error 14 ms 2752 KB Execution killed with signal 11
31 Runtime error 14 ms 2784 KB Execution killed with signal 11
32 Runtime error 15 ms 3036 KB Execution killed with signal 11
33 Runtime error 15 ms 2780 KB Execution killed with signal 11
34 Runtime error 14 ms 2776 KB Execution killed with signal 11
35 Runtime error 16 ms 2784 KB Execution killed with signal 11
36 Runtime error 16 ms 2748 KB Execution killed with signal 11
37 Runtime error 15 ms 2816 KB Execution killed with signal 11
38 Runtime error 15 ms 2772 KB Execution killed with signal 11
39 Runtime error 16 ms 2680 KB Execution killed with signal 11
40 Runtime error 14 ms 2772 KB Execution killed with signal 11