Submission #231510

# Submission time Handle Problem Language Result Execution time Memory
231510 2020-05-13T21:06:53 Z cstuart Broken Device (JOI17_broken_device) C++17
0 / 100
6 ms 640 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[3] = {"0011", "0101", "1001"};
  
  memset(fuc, 1, sizeof fuc);
  for (int i = 0; i < K; i++) fuc[P[i]] = 0;
  
  for (int s = 0; s < 3; s++) {
    init = 0;
    b = 0;
    for (int i = 0; i < N; i++) {
      if (!fuc[i]) pre[i] = 0;
      else if (!init && i % 3 == 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;
    }
  }
 
  assert(false);
}
#include <bits/stdc++.h>
using namespace std;
#include "Brunolib.h"
 
long long Bruno (int N, int A[]) {
  
  string     rep[3] = {"0011", "0101", "1001"};
  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 % 3;
      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 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)