답안 #300149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
300149 2020-09-16T21:10:21 Z mode149256 Broken Device (JOI17_broken_device) C++14
0 / 100
49 ms 3584 KB
/*input

*/
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;

namespace my_template {
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef vector<pi> vpi;
typedef vector<vpi> vpii;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<pd> vpd;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef std::string str;
typedef std::vector<str> vs;

#define x first
#define y second
#define debug(...) cout<<"["<<#__VA_ARGS__<<": "<<__VA_ARGS__<<"]\n"

const ld PI = 3.14159265358979323846264338327950288419716939937510582097494L;

template<typename T>
pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x + b.x, a.y + b.y); }
template<typename T>
pair<T, T> operator-(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x - b.x, a.y - b.y); }
template<typename T>
T operator*(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.x + a.y * b.y); }
template<typename T>
T operator^(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.y - a.y * b.x); }

template<typename T>
void print(vector<T> vec, string name = "") {
	cout << name;
	for (auto u : vec)
		cout << u << ' ';
	cout << '\n';
}
}
using namespace my_template;

const int MOD = 1000000007;
const ll INF = std::numeric_limits<ll>::max();
const int MX = 100101;

const int LG = 60;

void Anna(int N, ll X, int K, int P[] ) {
	vi geras(N, 1);
	for (int i = 0; i < K; ++i)
		geras[P[i]] = 0;

	vi x;
	for (int i = 0; i < LG; ++i)
	{
		x.emplace_back((X >> i) & 1);
	}

	int j = 0;
	for (int i = 0; i < N; i++) {
		if (i + 1 < N and geras[i] and geras[i + 1] and j < LG) {
			Set(i, 1);
			Set(i + 1, x[j++]);
			i++;
		} else if (i + 1 < N and geras[i] and !geras[i + 1] and j < LG and x[j] == 0) {
			Set(i, 1);
			Set(i + 1, x[j++]);
			i++;
		} else {
			Set(i, 0);
		}
	}
	// printf("in Anna j = %d, lg = %d\n", j, LG);
	// assert(j == LG);
}
/*input

*/
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;

namespace my_template {
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef vector<pi> vpi;
typedef vector<vpi> vpii;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<pd> vpd;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef std::string str;
typedef std::vector<str> vs;

#define x first
#define y second
#define debug(...) cout<<"["<<#__VA_ARGS__<<": "<<__VA_ARGS__<<"]\n"

const ld PI = 3.14159265358979323846264338327950288419716939937510582097494L;

template<typename T>
pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x + b.x, a.y + b.y); }
template<typename T>
pair<T, T> operator-(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x - b.x, a.y - b.y); }
template<typename T>
T operator*(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.x + a.y * b.y); }
template<typename T>
T operator^(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.y - a.y * b.x); }

template<typename T>
void print(vector<T> vec, string name = "") {
	cout << name;
	for (auto u : vec)
		cout << u << ' ';
	cout << '\n';
}
}
using namespace my_template;

const int MOD = 1000000007;
const ll INF = std::numeric_limits<ll>::max();
const int MX = 100101;

long long Bruno(int N, int A[] ) {
	ll ats = 0;
	int b = 0;
	for (int i = 0; i < N; ++i)
	{
		if (A[i]) {
			ats |= (A[i + 1] << (b++));
			i++;
		}
	}
	return ats;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 45 ms 3312 KB Output isn't correct - L* = 0
2 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
3 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
4 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
5 Partially correct 45 ms 3568 KB Output isn't correct - L* = 0
6 Partially correct 45 ms 3328 KB Output isn't correct - L* = 0
7 Partially correct 46 ms 3328 KB Output isn't correct - L* = 0
8 Partially correct 43 ms 3328 KB Output isn't correct - L* = 0
9 Partially correct 44 ms 3312 KB Output isn't correct - L* = 0
10 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
11 Partially correct 44 ms 3312 KB Output isn't correct - L* = 0
12 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
13 Partially correct 45 ms 3328 KB Output isn't correct - L* = 0
14 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
15 Partially correct 49 ms 3320 KB Output isn't correct - L* = 0
16 Partially correct 46 ms 3312 KB Output isn't correct - L* = 0
17 Partially correct 45 ms 3312 KB Output isn't correct - L* = 0
18 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
19 Partially correct 44 ms 3312 KB Output isn't correct - L* = 0
20 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
21 Partially correct 46 ms 3328 KB Output isn't correct - L* = 0
22 Partially correct 46 ms 3328 KB Output isn't correct - L* = 0
23 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
24 Partially correct 45 ms 3328 KB Output isn't correct - L* = 0
25 Partially correct 47 ms 3328 KB Output isn't correct - L* = 0
26 Partially correct 46 ms 3328 KB Output isn't correct - L* = 0
27 Partially correct 45 ms 3328 KB Output isn't correct - L* = 0
28 Partially correct 45 ms 3312 KB Output isn't correct - L* = 0
29 Partially correct 43 ms 3312 KB Output isn't correct - L* = 0
30 Partially correct 48 ms 3328 KB Output isn't correct - L* = 0
31 Partially correct 43 ms 3312 KB Output isn't correct - L* = 0
32 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
33 Partially correct 44 ms 3312 KB Output isn't correct - L* = 0
34 Partially correct 43 ms 3328 KB Output isn't correct - L* = 0
35 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
36 Partially correct 45 ms 3584 KB Output isn't correct - L* = 0
37 Partially correct 44 ms 3328 KB Output isn't correct - L* = 0
38 Partially correct 44 ms 3584 KB Output isn't correct - L* = 0
39 Partially correct 45 ms 3312 KB Output isn't correct - L* = 0
40 Partially correct 44 ms 3312 KB Output isn't correct - L* = 0