Submission #990770

# Submission time Handle Problem Language Result Execution time Memory
990770 2024-05-31T09:13:07 Z abczz Broken Device (JOI17_broken_device) C++14
57 / 100
146 ms 2960 KB
#include "Annalib.h"
#include <iostream>
#include <random>
#define ll long long

using namespace std;

void Anna( int N, long long X, int K, int P[] ){
  srand(7318371);
  ll x = 805215019090496300, L[60][150];
  bool B[150], F[150];
  for (int i=0; i<N; ++i) B[i] = F[i] = 0;
  for (int i=0; i<K; ++i) B[P[i]] = 1;
  x ^= X;
  for (int i=0; i<60; ++i) {
    L[i][0] = rand() & 1;
    L[i][1] = L[i][0] ^ 1;
    for (int j=2; j<N; ++j) {
      L[i][j] = rand() & 1;
    }
  }
  ll p = 0;
  for (int i=59; i>=0; --i) {
    ll bit = (bool)(x & (1LL<<i));
    for (int j=0; j<N; ++j) {
      if (L[i][j] == bit && !B[p+j]) {
        //cout << i << " " << j << endl;
        F[p+j] = 1;
        p += j+1;
        break;
      }
    }
  }
  for (int i=0; i<N; ++i) {
    Set(i, F[i]);
  }
}
#include "Brunolib.h"
#include <iostream>
#include <vector>
#include <random>
#define ll long long

using namespace std;

long long Bruno( int N, int A[] ){
  srand(7318371);
  ll x = 805215019090496300, L[60][150];
  vector <ll> V;
  for (int i=0; i<60; ++i) {
    L[i][0] = rand() & 1;
    L[i][1] = L[i][0] ^ 1;
    for (int j=2; j<N; ++j) {
      L[i][j] = rand() & 1;
    }
  }
  ll p = 0;
  for (int i=0; i<N; ++i) {
    if (A[i]) {
      V.push_back(i);
    }
  }
  int j = 0;
  for (int i=59; i>=0; --i) {
    //cout << V[j]-p << " ";
    if (L[i][V[j]-p]) x ^= (1LL<<i);
    p = V[j++]+1;
  }
  //cout << endl;
  //cout << x << endl;
  return x;
}
# Verdict Execution time Memory Grader output
1 Partially correct 138 ms 2696 KB Output is partially correct - L* = 30
2 Partially correct 138 ms 2508 KB Output is partially correct - L* = 31
3 Partially correct 140 ms 2700 KB Output is partially correct - L* = 31
4 Partially correct 138 ms 2560 KB Output is partially correct - L* = 33
5 Partially correct 140 ms 2552 KB Output is partially correct - L* = 34
6 Partially correct 137 ms 2484 KB Output is partially correct - L* = 31
7 Partially correct 143 ms 2560 KB Output is partially correct - L* = 35
8 Partially correct 138 ms 2696 KB Output is partially correct - L* = 29
9 Partially correct 140 ms 2368 KB Output is partially correct - L* = 33
10 Partially correct 137 ms 2460 KB Output is partially correct - L* = 37
11 Partially correct 134 ms 2568 KB Output is partially correct - L* = 37
12 Partially correct 138 ms 2392 KB Output is partially correct - L* = 34
13 Partially correct 138 ms 2692 KB Output is partially correct - L* = 37
14 Partially correct 134 ms 2556 KB Output is partially correct - L* = 35
15 Partially correct 138 ms 2556 KB Output is partially correct - L* = 34
16 Partially correct 139 ms 2532 KB Output is partially correct - L* = 33
17 Partially correct 142 ms 2552 KB Output is partially correct - L* = 32
18 Partially correct 146 ms 2560 KB Output is partially correct - L* = 34
19 Partially correct 137 ms 2560 KB Output is partially correct - L* = 32
20 Partially correct 137 ms 2620 KB Output is partially correct - L* = 33
21 Partially correct 139 ms 2400 KB Output is partially correct - L* = 32
22 Partially correct 138 ms 2564 KB Output is partially correct - L* = 34
23 Partially correct 140 ms 2568 KB Output is partially correct - L* = 27
24 Partially correct 138 ms 2660 KB Output is partially correct - L* = 37
25 Partially correct 137 ms 2556 KB Output is partially correct - L* = 31
26 Partially correct 137 ms 2568 KB Output is partially correct - L* = 34
27 Partially correct 138 ms 2480 KB Output is partially correct - L* = 33
28 Partially correct 139 ms 2656 KB Output is partially correct - L* = 34
29 Partially correct 144 ms 2708 KB Output is partially correct - L* = 33
30 Partially correct 140 ms 2412 KB Output is partially correct - L* = 37
31 Partially correct 137 ms 2708 KB Output is partially correct - L* = 35
32 Partially correct 137 ms 2508 KB Output is partially correct - L* = 23
33 Partially correct 139 ms 2556 KB Output is partially correct - L* = 36
34 Partially correct 137 ms 2564 KB Output is partially correct - L* = 35
35 Partially correct 142 ms 2556 KB Output is partially correct - L* = 36
36 Partially correct 139 ms 2460 KB Output is partially correct - L* = 33
37 Partially correct 137 ms 2680 KB Output is partially correct - L* = 32
38 Partially correct 137 ms 2960 KB Output is partially correct - L* = 34
39 Partially correct 140 ms 2696 KB Output is partially correct - L* = 28
40 Partially correct 138 ms 2692 KB Output is partially correct - L* = 35