Submission #1260893

#TimeUsernameProblemLanguageResultExecution timeMemory
1260893M_W_13Question (Grader is different from the original contest) (CEOI14_question_grader)C++20
0 / 100
7094 ms416 KiB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define st first
#define nd second
#define pb push_back

pair<int, int> przerzut(int a, int b) {
  int c = 0;
  rep(i, max(a, b)) {
    while (__builtin_popcount(c) < 6) {
      c++;
    }
    if ((i + 1) == a) {
      a = c;
    }
    if ((i + 1) == b) {
      b = c;
    }
    c++;
  }
  return {a, b};
}

int encode (int n, int x, int y) {
  pair<int, int> p = przerzut(x, y);
  int a = 1;
  int kt = 1;
  while (true) {
    if (((a & p.st) == a) && ((a & p.nd) != a)) {
      return kt;
    }
    a *= 2;
    kt++;
  }
  return 0;
}
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define st first
#define nd second
#define pb push_back

pair<int, int> przerzut(int a, int b) {
  int c = 0;
  rep(i, max(a, b)) {
    while (__builtin_popcount(c) < 6) {
      c++;
    }
    if ((i + 1) == a) {
      a = c;
    }
    if ((i + 1) == b) {
      b = c;
    }
    c++;
  }
  return {a, b};
}

int decode (int n, int q, int h) {
	q = przerzut(q, q).st;
	int a = 1;
	rep(i, h) {
		a *= 2;
	}
	if ((a & q) == a) {
		return 1;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...