Submission #231535

# Submission time Handle Problem Language Result Execution time Memory
231535 2020-05-13T22:52:33 Z cstuart Broken Device (JOI17_broken_device) C++17
47 / 100
54 ms 3072 KB
#include <bits/stdc++.h>
using namespace std;
#include "Annalib.h"
 
void Anna (int N, long long X, int K, int P[]) {
  
  bool     fuc[N+5], init;
  int      pre[N+5], b;
  string   rep[4] = {"011001111000110101100001010001000110011010001111010000101100111000110101110111110001100101111111000011010000011001010110010011000011010011001010100110","100110000111001010011110101110111001100101110000101111010011000111001010001000001110011010000000111100101111100110101001101100111100101100110101011001","110110111111101011101111100100100011111111111110011011011000111001101111101111111111010100011111111001111111011111111111011111111001101010000111101110","001100101000111100010000110101101000101100101101000011000000000101001110100000100000100111011110010100101000001100000111000111010000100011000010000110"};
  
  memset(fuc, 1, sizeof fuc);
  for (int i = 0; i < K; i++) fuc[P[i]] = 0;
  
  for (int s = 0; s < 4; s++) {
    init = 0;
    b = 0;
    for (int i = 0; i < N; i++) {
      if (!fuc[i]) pre[i] = 0;
      else if (!init && i % 4 == s) pre[i] = 1, init = 1;
      else if (!init) pre[i] = 0;
      else if (b == 60) pre[i] = 0;
      else if (((1ll << b) & X) == 0 && rep[s][i % (int)rep[s].length()] == '1') pre[i] = 0;
      else if (((1ll << b) & X) > 0  && rep[s][i % (int)rep[s].length()] == '0') pre[i] = 0;
      else pre[i] = 1, b++;
    }
    if (b == 60) {
      for (int i = 0; i < N; i++) Set(i, pre[i]);
      return;
    }
  }
  
  for (int i = 0; i < N; i++) Set(i, pre[i]);
  
}
#include <bits/stdc++.h>
using namespace std;
#include "Brunolib.h"
 
long long Bruno (int N, int A[]) {
  
  string     rep[4] = {"011001111000110101100001010001000110011010001111010000101100111000110101110111110001100101111111000011010000011001010110010011000011010011001010100110","100110000111001010011110101110111001100101110000101111010011000111001010001000001110011010000000111100101111100110101001101100111100101100110101011001","110110111111101011101111100100100011111111111110011011011000111001101111101111111111010100011111111001111111011111111111011111111001101010000111101110","001100101000111100010000110101101000101100101101000011000000000101001110100000100000100111011110010100101000001100000111000111010000100011000010000110"};
  long long  V = 0;
  int        s = -1;
  int        b = 0;
  
  for (int i = 0; i < N; i++) {
    if (A[i] == 1) {
      if (s == -1) s = i % 4;
      else if (rep[s][i % (int)rep[s].length()] == '1') V += (1ll << b), b++;
      else b++;
    }
  }
  
  return V;
}
# Verdict Execution time Memory Grader output
1 Partially correct 50 ms 3056 KB Output is partially correct - L* = 26
2 Partially correct 54 ms 3056 KB Output is partially correct - L* = 30
3 Partially correct 48 ms 3056 KB Output is partially correct - L* = 26
4 Partially correct 50 ms 2800 KB Output is partially correct - L* = 28
5 Partially correct 48 ms 3056 KB Output is partially correct - L* = 25
6 Partially correct 51 ms 3056 KB Output is partially correct - L* = 22
7 Partially correct 49 ms 3056 KB Output is partially correct - L* = 25
8 Partially correct 52 ms 3072 KB Output is partially correct - L* = 20
9 Partially correct 49 ms 3072 KB Output is partially correct - L* = 29
10 Partially correct 50 ms 3056 KB Output is partially correct - L* = 25
11 Partially correct 49 ms 3072 KB Output is partially correct - L* = 18
12 Partially correct 48 ms 3064 KB Output is partially correct - L* = 28
13 Partially correct 49 ms 3072 KB Output is partially correct - L* = 21
14 Partially correct 53 ms 3056 KB Output is partially correct - L* = 26
15 Partially correct 51 ms 3072 KB Output is partially correct - L* = 27
16 Partially correct 50 ms 3072 KB Output is partially correct - L* = 26
17 Partially correct 48 ms 3072 KB Output is partially correct - L* = 28
18 Partially correct 49 ms 3072 KB Output is partially correct - L* = 22
19 Partially correct 51 ms 3056 KB Output is partially correct - L* = 31
20 Partially correct 48 ms 3072 KB Output is partially correct - L* = 27
21 Partially correct 49 ms 3072 KB Output is partially correct - L* = 24
22 Partially correct 49 ms 3072 KB Output is partially correct - L* = 25
23 Partially correct 49 ms 3000 KB Output is partially correct - L* = 31
24 Partially correct 49 ms 3056 KB Output is partially correct - L* = 23
25 Partially correct 52 ms 3072 KB Output is partially correct - L* = 21
26 Partially correct 49 ms 3056 KB Output is partially correct - L* = 27
27 Partially correct 49 ms 3056 KB Output is partially correct - L* = 22
28 Partially correct 49 ms 3056 KB Output is partially correct - L* = 23
29 Partially correct 49 ms 3072 KB Output is partially correct - L* = 26
30 Partially correct 50 ms 3072 KB Output is partially correct - L* = 27
31 Partially correct 48 ms 3072 KB Output is partially correct - L* = 20
32 Partially correct 49 ms 3072 KB Output is partially correct - L* = 26
33 Partially correct 54 ms 3056 KB Output is partially correct - L* = 28
34 Partially correct 49 ms 3072 KB Output is partially correct - L* = 28
35 Partially correct 49 ms 3056 KB Output is partially correct - L* = 22
36 Partially correct 49 ms 3072 KB Output is partially correct - L* = 28
37 Partially correct 50 ms 3056 KB Output is partially correct - L* = 24
38 Partially correct 50 ms 3056 KB Output is partially correct - L* = 28
39 Partially correct 51 ms 3072 KB Output is partially correct - L* = 32
40 Partially correct 51 ms 3072 KB Output is partially correct - L* = 21