답안 #934822

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
934822 2024-02-28T04:47:15 Z nguyentunglam Broken Device 2 (JOI22_device2) C++17
80 / 100
66 ms 3900 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);
  }

  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;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 15 ms 1160 KB Output is correct
3 Correct 16 ms 1360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 15 ms 1160 KB Output is correct
3 Correct 16 ms 1360 KB Output is correct
4 Correct 27 ms 1808 KB Output is correct
5 Correct 27 ms 1896 KB Output is correct
6 Correct 27 ms 1800 KB Output is correct
7 Correct 27 ms 2056 KB Output is correct
8 Correct 27 ms 1800 KB Output is correct
9 Correct 26 ms 1832 KB Output is correct
10 Correct 24 ms 1796 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 15 ms 1160 KB Output is correct
3 Correct 16 ms 1360 KB Output is correct
4 Correct 27 ms 1808 KB Output is correct
5 Correct 27 ms 1896 KB Output is correct
6 Correct 27 ms 1800 KB Output is correct
7 Correct 27 ms 2056 KB Output is correct
8 Correct 27 ms 1800 KB Output is correct
9 Correct 26 ms 1832 KB Output is correct
10 Correct 24 ms 1796 KB Output is correct
11 Correct 28 ms 1804 KB Output is correct
12 Correct 28 ms 1800 KB Output is correct
13 Correct 28 ms 1824 KB Output is correct
14 Correct 28 ms 1796 KB Output is correct
15 Correct 28 ms 1832 KB Output is correct
16 Correct 27 ms 1848 KB Output is correct
17 Correct 26 ms 1824 KB Output is correct
18 Correct 24 ms 1792 KB Output is correct
19 Correct 26 ms 1704 KB Output is correct
20 Correct 26 ms 1748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 15 ms 1160 KB Output is correct
3 Correct 16 ms 1360 KB Output is correct
4 Correct 27 ms 1808 KB Output is correct
5 Correct 27 ms 1896 KB Output is correct
6 Correct 27 ms 1800 KB Output is correct
7 Correct 27 ms 2056 KB Output is correct
8 Correct 27 ms 1800 KB Output is correct
9 Correct 26 ms 1832 KB Output is correct
10 Correct 24 ms 1796 KB Output is correct
11 Correct 28 ms 1804 KB Output is correct
12 Correct 28 ms 1800 KB Output is correct
13 Correct 28 ms 1824 KB Output is correct
14 Correct 28 ms 1796 KB Output is correct
15 Correct 28 ms 1832 KB Output is correct
16 Correct 27 ms 1848 KB Output is correct
17 Correct 26 ms 1824 KB Output is correct
18 Correct 24 ms 1792 KB Output is correct
19 Correct 26 ms 1704 KB Output is correct
20 Correct 26 ms 1748 KB Output is correct
21 Correct 36 ms 2384 KB Output is correct
22 Correct 34 ms 2012 KB Output is correct
23 Correct 31 ms 2132 KB Output is correct
24 Correct 31 ms 2008 KB Output is correct
25 Correct 39 ms 2028 KB Output is correct
26 Correct 32 ms 2132 KB Output is correct
27 Correct 28 ms 2136 KB Output is correct
28 Correct 28 ms 1932 KB Output is correct
29 Correct 28 ms 1912 KB Output is correct
30 Correct 28 ms 1828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 15 ms 1160 KB Output is correct
3 Correct 16 ms 1360 KB Output is correct
4 Correct 27 ms 1808 KB Output is correct
5 Correct 27 ms 1896 KB Output is correct
6 Correct 27 ms 1800 KB Output is correct
7 Correct 27 ms 2056 KB Output is correct
8 Correct 27 ms 1800 KB Output is correct
9 Correct 26 ms 1832 KB Output is correct
10 Correct 24 ms 1796 KB Output is correct
11 Correct 28 ms 1804 KB Output is correct
12 Correct 28 ms 1800 KB Output is correct
13 Correct 28 ms 1824 KB Output is correct
14 Correct 28 ms 1796 KB Output is correct
15 Correct 28 ms 1832 KB Output is correct
16 Correct 27 ms 1848 KB Output is correct
17 Correct 26 ms 1824 KB Output is correct
18 Correct 24 ms 1792 KB Output is correct
19 Correct 26 ms 1704 KB Output is correct
20 Correct 26 ms 1748 KB Output is correct
21 Correct 36 ms 2384 KB Output is correct
22 Correct 34 ms 2012 KB Output is correct
23 Correct 31 ms 2132 KB Output is correct
24 Correct 31 ms 2008 KB Output is correct
25 Correct 39 ms 2028 KB Output is correct
26 Correct 32 ms 2132 KB Output is correct
27 Correct 28 ms 2136 KB Output is correct
28 Correct 28 ms 1932 KB Output is correct
29 Correct 28 ms 1912 KB Output is correct
30 Correct 28 ms 1828 KB Output is correct
31 Correct 41 ms 2464 KB Output is correct
32 Correct 45 ms 2772 KB Output is correct
33 Correct 40 ms 2416 KB Output is correct
34 Correct 41 ms 2424 KB Output is correct
35 Correct 43 ms 2484 KB Output is correct
36 Correct 41 ms 2504 KB Output is correct
37 Correct 37 ms 2524 KB Output is correct
38 Correct 38 ms 2320 KB Output is correct
39 Correct 37 ms 2240 KB Output is correct
40 Correct 37 ms 2368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 63 ms 3672 KB Output is partially correct
2 Partially correct 64 ms 3552 KB Output is partially correct
3 Partially correct 62 ms 3616 KB Output is partially correct
4 Partially correct 62 ms 3472 KB Output is partially correct
5 Partially correct 63 ms 3536 KB Output is partially correct
6 Partially correct 65 ms 3556 KB Output is partially correct
7 Partially correct 62 ms 3544 KB Output is partially correct
8 Partially correct 66 ms 3900 KB Output is partially correct
9 Partially correct 62 ms 3576 KB Output is partially correct
10 Partially correct 62 ms 3476 KB Output is partially correct
11 Partially correct 62 ms 3696 KB Output is partially correct
12 Partially correct 62 ms 3840 KB Output is partially correct
13 Partially correct 61 ms 3648 KB Output is partially correct
14 Partially correct 57 ms 3480 KB Output is partially correct
15 Partially correct 56 ms 3472 KB Output is partially correct
16 Partially correct 55 ms 3652 KB Output is partially correct
17 Partially correct 54 ms 3392 KB Output is partially correct
18 Partially correct 60 ms 3668 KB Output is partially correct
19 Partially correct 55 ms 3188 KB Output is partially correct
20 Partially correct 55 ms 3420 KB Output is partially correct