Submission #448134

#TimeUsernameProblemLanguageResultExecution timeMemory
448134JovanBBroken Device (JOI17_broken_device)C++17
0 / 100
47 ms2648 KiB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

static const ll K = 626237348924392349LL;

static int radi[1005];

void Anna(int _n, long long X, int K, int P[] ){
    int n = _n;
    for(int i=0; i<n; i++) radi[i] = 1;
    for(int i=0; i<K; i++) radi[P[i]] = 0;
    X ^= K;
    int j = 0;
    for(int i=0; i<35; i++){
        int treba = X%3;
        X /= 3;
        treba++;
        for(;;){
            if(treba/2 <= radi[j] && treba%2 <= radi[j+1]){
                Set(j, treba/2);
                Set(j+1, treba%2);
                j += 2;
                break;
            }
            Set(j, 0);
            Set(j+1, 0);
            j += 2;
        }
    }
    while(j < n){
        Set(j, 0);
        j++;
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

static const ll K = 626237348924392349LL;

long long Bruno( int N, int A[] ){
    int j = 0;
    ll p3 = 1;
    ll res = 0;
    for(int i=0; i<35; i++){
        int tr;
        for(;;){
            tr = 2*A[j] + A[j+1];
            j += 2;
            if(tr) break;
        }
        res += (tr-1)*p3;
        p3 *= 3;
    }
    return res ^ K;
}
#Verdict Execution timeMemoryGrader output
Fetching results...