# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231571 | syy | Broken Device (JOI17_broken_device) | C++17 | 62 ms | 3328 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(ll i = (ll)a; i <= (ll)b; i++)
#define DEC(i, a, b) for(ll i = (ll)a; i >= (ll)b; i--)
typedef pair<ll, ll> pi;
#define f first
#define s second
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
void Anna(int n, long long x, int k, int p[]){
bool ok[155], used[155];
memset(ok, 1, sizeof ok);
memset(used, 0, sizeof used);
FOR(i, 0, k-1) ok[p[i]] = 0;
ll cur = 0;
FOR(i, 0, n-2) if (ok[i] and ok[i+1]) {
Set(i, 1);
Set(i+1, ((x >> cur) & 1));
used[i] = 1; used[i+1] = 1;
i++; cur++;
}
FOR(i, 0, n-1) if (!used[i]) Set(i, 0);
}
//#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(ll i = (ll)a; i <= (ll)b; i++)
#define DEC(i, a, b) for(ll i = (ll)a; i >= (ll)b; i--)
typedef pair<ll, ll> pi;
#define f first
#define s second
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
long long Bruno(int n, int arr[] ){
ll cur = 0; ll res = 0;
FOR(i, 0, n-2) if (arr[i] == 1) {
res += (ll) (((ll)arr[i+1]) << cur);
i++; cur++;
if (cur > 62) break;
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |