Submission #934821

# Submission time Handle Problem Language Result Execution time Memory
934821 2024-02-28T04:46:46 Z nguyentunglam Broken Device 2 (JOI22_device2) C++17
0 / 100
41 ms 3448 KB
#include "Anna.h"
#include <utility>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

namespace {

int x = 0;
}

int Declare() {
  return 180;
}

std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
  int m = log2(A) + 1;
  vector<int> s, t;
  for(int i = 0; i < m; i++) {
    s.push_back(A >> i & 1);
    s.push_back(A >> i & 1);
    s.push_back(A >> i & 1);
  }

  cout << m << endl;

  for(int i = 0, cur = 0; i < 3 * m; i++) {
    t.push_back(cur ^= 1);
  }

  return make_pair(s, t);
}
#include "Bruno.h"
#include <utility>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 0;

}

long long Bruno(std::vector<int> u) {
  vector<int> bit;
  int real_sum = 0, fake_sum = 0;

  for(int &j : u) {
    if (j == 0) fake_sum--;
    else fake_sum++;
    if (fake_sum >= real_sum + 3) {
      real_sum += 3;
      bit.push_back(1);
    }
    if (fake_sum <= real_sum - 2) {
      real_sum -= 3;
      bit.push_back(0);
    }
  }
  long long ans = 0;
  for(int j = 0; j < bit.size(); j++) if (bit[j]) ans |= (1LL << j);
  return ans;
}

Compilation message

Anna.cpp:9:5: warning: '{anonymous}::x' defined but not used [-Wunused-variable]
    9 | int x = 0;
      |     ^

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:30:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |   for(int j = 0; j < bit.size(); j++) if (bit[j]) ans |= (1LL << j);
      |                  ~~^~~~~~~~~~~~
Bruno.cpp: At global scope:
Bruno.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 3448 KB Do not print anything to stdout
2 Halted 0 ms 0 KB -