답안 #1001125

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1001125 2024-06-18T15:14:36 Z Tob Broken Device (JOI17_broken_device) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "Annalib.h"

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <ll, ll> pii;

void Anna(int n, ll x, int k, int p[]) {
	int bio[150] = {0}, a[150] = {0};
	for (int i = 0; i < k; i++) bio[p[i]] = 1;
	for (ll i = 0, j = 0; i < n; i += 3) {
		int sum = bio[i]+bio[i+1]+bio[i+2];
		if (sum > 1) continue;
		int o = ((x >> j) & 1), o2 = ((x >> (j+1)) & 1);
		if (o) {
			if (sum == 0) a[i+1] = a[i+2] = 1, a[i] = o2, j += 2;
			else a[i] = bio[i+2], a[i+1] = bio[i+2], a[i+2] = bio[i+2]^1, j++;
		}
		else {
			if (bio[i+1] || sum == 0) a[i] = 1, a[i+2] = o2, j += 2;
			else a[i+1] = 1, j++;
		}
	}
	for (int i = 0; i < n; i++) Set(i, a[i]);
}
#include <bits/stdc++.h>
#include "Brunolib.h"

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <ll, ll> pii;

ll Bruno(int n, int a[]) {
	ll x = 0;
	for (int i = n-3; i >= 0; i -= 3) {
		int o = 4*a[i]+2*a[i+1]+a[i+2];
		if (o == 0) continue;
		if (zn[o] == 1) x = 2*x+va[o];
		else x = 4*x+va[o];
	}
	return x;
}

Compilation message

Bruno.cpp: In function 'll Bruno(int, int*)':
Bruno.cpp:20:7: error: 'zn' was not declared in this scope; did you mean 'n'?
   20 |   if (zn[o] == 1) x = 2*x+va[o];
      |       ^~
      |       n
Bruno.cpp:20:27: error: 'va' was not declared in this scope; did you mean 'a'?
   20 |   if (zn[o] == 1) x = 2*x+va[o];
      |                           ^~
      |                           a
Bruno.cpp:21:16: error: 'va' was not declared in this scope; did you mean 'a'?
   21 |   else x = 4*x+va[o];
      |                ^~
      |                a