Submission #231580

# Submission time Handle Problem Language Result Execution time Memory
231580 2020-05-14T04:15:51 Z syy Broken Device (JOI17_broken_device) C++17
0 / 100
122 ms 3072 KB
#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)

bool res[155], no[155];
int num[55], x, val[65];

void up(ll x, ll a, ll b, ll c) {
	res[3*x] = a;
	res[3*x+1] = b;
	res[3*x+2] = c;
}

void Anna(int n, long long X, int k, int p[]){
	FOR(i, 0, 59) {
		val[i] = X % 2;
		X /= 2;
	}
	FOR(i, 0, k-1) {
		no[p[i]] = 1;
		num[p[i]/3]++;
	}
	FOR(i, 0, n/3-1) {
		if (x >= 60) break;
		if (num[i] == 0) {
			ll t = 2*val[x] + val[x+1];
			if (t == 0) up(i, 1, 0, 0);
			else if (t == 1) up(i, 1, 0, 1);
			else if (t == 2) up(i, 0, 1, 1);
			else up(i, 1, 1, 1);
			x += 2;
		} else if (num[i] == 1) {
			if (no[3*i]) {
				if (val[x] == 0) up(i, 0, 1, 0);
				else up(i, 0, 0, 1);
				x++;
			} else if (no[3*i+1]) {
				if (val[x] == 1) { //1
					up(i, 0, 0, 1);
					x++;
				} else if (val[x+1] == 0) { //00
					up(i, 1, 0, 0);
					x += 2;
				} else if (val[x+1] == 1) { //01
					up(i, 1, 0, 1);
					x += 2;
				}
			} else {
				if (val[x] == 0) up(i, 0, 1, 0);
				else up(i, 1, 1, 0);
				x++;
			}
		}
	}
	FOR(i, 0, n-1) Set(i, res[i]);
}
#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)

string ans;
ll v;
string tos[] = {"", "1", "0", "10", "00", "01", "1", "11"};

long long Bruno(int n, int arr[] ){
	FOR(i, 0, n/3-1) {
		int t = 4*arr[3*i] + 2*arr[3*i+1] + arr[3*i+2];
		if (t == 0) continue;
		ans += tos[t];
	}
	FOR(i, 0, ans.length()-1) {
		if (ans[i] == '1') v += ((ll) (1ll<<i));
	}
	return v;
}
# Verdict Execution time Memory Grader output
1 Partially correct 92 ms 3072 KB Output isn't correct - L* = 0
2 Partially correct 64 ms 3072 KB Output isn't correct - L* = 0
3 Partially correct 69 ms 3072 KB Output isn't correct - L* = 0
4 Partially correct 111 ms 3056 KB Output isn't correct - L* = 0
5 Partially correct 94 ms 3072 KB Output isn't correct - L* = 0
6 Partially correct 112 ms 3072 KB Output isn't correct - L* = 0
7 Partially correct 112 ms 3072 KB Output isn't correct - L* = 0
8 Partially correct 67 ms 3072 KB Output isn't correct - L* = 0
9 Partially correct 94 ms 3072 KB Output isn't correct - L* = 0
10 Partially correct 115 ms 3056 KB Output isn't correct - L* = 0
11 Partially correct 96 ms 3072 KB Output isn't correct - L* = 0
12 Partially correct 113 ms 3072 KB Output isn't correct - L* = 0
13 Partially correct 114 ms 3056 KB Output isn't correct - L* = 0
14 Partially correct 66 ms 3072 KB Output isn't correct - L* = 0
15 Partially correct 122 ms 3056 KB Output isn't correct - L* = 0
16 Partially correct 117 ms 3064 KB Output isn't correct - L* = 0
17 Partially correct 88 ms 3072 KB Output isn't correct - L* = 0
18 Partially correct 97 ms 3072 KB Output isn't correct - L* = 0
19 Partially correct 114 ms 3072 KB Output isn't correct - L* = 0
20 Partially correct 95 ms 3072 KB Output isn't correct - L* = 0
21 Partially correct 96 ms 3056 KB Output isn't correct - L* = 0
22 Partially correct 107 ms 3072 KB Output isn't correct - L* = 0
23 Partially correct 121 ms 3072 KB Output isn't correct - L* = 0
24 Partially correct 113 ms 3072 KB Output isn't correct - L* = 0
25 Partially correct 112 ms 3072 KB Output isn't correct - L* = 0
26 Partially correct 67 ms 3072 KB Output isn't correct - L* = 0
27 Partially correct 83 ms 3072 KB Output isn't correct - L* = 0
28 Partially correct 113 ms 3072 KB Output isn't correct - L* = 0
29 Partially correct 94 ms 3072 KB Output isn't correct - L* = 0
30 Partially correct 117 ms 3072 KB Output isn't correct - L* = 0
31 Partially correct 68 ms 3072 KB Output isn't correct - L* = 0
32 Partially correct 117 ms 3072 KB Output isn't correct - L* = 0
33 Partially correct 113 ms 3072 KB Output isn't correct - L* = 0
34 Partially correct 112 ms 3072 KB Output isn't correct - L* = 0
35 Partially correct 104 ms 3072 KB Output isn't correct - L* = 0
36 Partially correct 115 ms 3072 KB Output isn't correct - L* = 0
37 Partially correct 120 ms 3072 KB Output isn't correct - L* = 0
38 Partially correct 94 ms 3072 KB Output isn't correct - L* = 0
39 Partially correct 113 ms 3056 KB Output isn't correct - L* = 0
40 Partially correct 121 ms 3072 KB Output isn't correct - L* = 0