Submission #231500

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