Submission #70298

# Submission time Handle Problem Language Result Execution time Memory
70298 2018-08-22T14:52:02 Z Just_Solve_The_Problem Broken Device (JOI17_broken_device) C++11
0 / 100
80 ms 12928 KB
#include <bits/stdc++.h>
#include "Annalib.h"
//#include "grader.cpp"

#define pb push_back

using namespace std;

void Anna( int N, long long X, int K, int P[] ){
  vector < int > used(N, 0);
  vector < int > u(N, 0);
  for (int i = 0; i < K; i++) {
    used[P[i]] = 1;
  }
  for (int i = 0; i < N; i += 3) {
    if (used[i] + used[i + 1] + used[i + 2] >= 2) continue;
    if (used[i] + used[i + 1] + used[i + 2] == 1) {
      if (X % 2 == 0) {
        if (used[i]) {
          u[i + 2] = 1;
        } else if (used[i + 1]) {
          u[i + 2] = 1;
        } else {
          u[i] = u[i + 1] = 1;
        }
      } else {
        if (used[i]) {
          if (X % 4 == 1) {
            u[i + 1] = 1;
          } else {
            u[i + 1] = u[i + 2] = 1;
          }
          X /= 2;
        }
        if (used[i + 1]) {
          u[i] = 1;
        }
        if (used[i + 2]) {
          u[i] = 1;
        }
      }
      X /= 2;
    } else {
      u[i] = u[i + 1] = u[i + 2] = 1;
      if (X % 4 == 1) u[i] = u[i + 2] = 0;
      else if (X % 4 == 2) u[i + 1] = 0;
      else if (X % 4 == 3) u[i] = 0;
      X /= 4;
    }
  }
  for (int i = 0; i < N; i++) {
    Set(i, u[i]);
  }
}
/*
7 = (3, 4)
6 = (2, 4)
5 = (1, 4)
4 = (0, 4)
3 = (1, 2)
2 = (0, 2)
1 = (0, 2)
0 = (1, 2)
*/
#include <bits/stdc++.h>
#include "Brunolib.h"
//#include "grader.cpp"

#define ll long long
#define pb push_back

using namespace std;

pair < int, int > get(int x, int y, int z) {
  int t = x * 4 + y * 2 + z;
  if (t == 0) return {0, 1};
  if (t == 1) return {0, 2};
  if (t == 2) return {1, 4};
  if (t == 3) return {3, 4};
  if (t == 4) return {1, 2};
  if (t == 5) return {1, 4};
  if (t == 6) return {0, 2};
  if (t == 7) return {0, 4};
}

long long Bruno( int N, int A[] ){
  ll ret = 0;
  for (int i = N - 4; i >= 0; i -= 3) {
    ret = ret * get(A[i], A[i + 1], A[i + 2]).second + get(A[i], A[i + 1], A[i + 2]).first;
  }
  return ret;
}

Compilation message

Bruno.cpp: In function 'std::pair<int, int> get(int, int, int)':
Bruno.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 61 ms 3872 KB Output isn't correct - L* = 0
3 Incorrect 73 ms 4312 KB Output isn't correct - L* = 0
4 Incorrect 68 ms 4360 KB Output isn't correct - L* = 0
5 Incorrect 50 ms 4600 KB Output isn't correct - L* = 0
6 Incorrect 51 ms 4880 KB Output isn't correct - L* = 0
7 Incorrect 52 ms 4912 KB Output isn't correct - L* = 0
8 Incorrect 69 ms 5160 KB Output isn't correct - L* = 0
9 Incorrect 61 ms 5408 KB Output isn't correct - L* = 0
10 Incorrect 50 ms 5912 KB Output isn't correct - L* = 0
11 Incorrect 73 ms 5912 KB Output isn't correct - L* = 0
12 Incorrect 48 ms 6136 KB Output isn't correct - L* = 0
13 Incorrect 64 ms 6368 KB Output isn't correct - L* = 0
14 Incorrect 80 ms 6616 KB Output isn't correct - L* = 0
15 Incorrect 49 ms 6856 KB Output isn't correct - L* = 0
16 Incorrect 65 ms 7096 KB Output isn't correct - L* = 0
17 Incorrect 45 ms 7344 KB Output isn't correct - L* = 0
18 Incorrect 48 ms 7584 KB Output isn't correct - L* = 0
19 Incorrect 54 ms 7824 KB Output isn't correct - L* = 0
20 Incorrect 48 ms 8072 KB Output isn't correct - L* = 0
21 Incorrect 57 ms 8296 KB Output isn't correct - L* = 0
22 Incorrect 61 ms 8536 KB Output isn't correct - L* = 0
23 Incorrect 63 ms 8776 KB Output isn't correct - L* = 0
24 Incorrect 75 ms 9016 KB Output isn't correct - L* = 0
25 Incorrect 57 ms 9264 KB Output isn't correct - L* = 0
26 Incorrect 49 ms 9512 KB Output isn't correct - L* = 0
27 Incorrect 48 ms 9760 KB Output isn't correct - L* = 0
28 Incorrect 72 ms 10008 KB Output isn't correct - L* = 0
29 Incorrect 66 ms 10248 KB Output isn't correct - L* = 0
30 Incorrect 59 ms 10496 KB Output isn't correct - L* = 0
31 Incorrect 53 ms 10736 KB Output isn't correct - L* = 0
32 Incorrect 59 ms 10976 KB Output isn't correct - L* = 0
33 Incorrect 47 ms 11232 KB Output isn't correct - L* = 0
34 Incorrect 49 ms 11464 KB Output isn't correct - L* = 0
35 Incorrect 64 ms 11912 KB Output isn't correct - L* = 0
36 Incorrect 51 ms 11952 KB Output isn't correct - L* = 0
37 Incorrect 49 ms 12200 KB Output isn't correct - L* = 0
38 Incorrect 57 ms 12448 KB Output isn't correct - L* = 0
39 Incorrect 54 ms 12688 KB Output isn't correct - L* = 0
40 Incorrect 52 ms 12928 KB Output isn't correct - L* = 0