답안 #990768

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
990768 2024-05-31T09:01:03 Z abczz Broken Device (JOI17_broken_device) C++14
41 / 100
155 ms 2980 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 = 580879096216018200, 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) {
    for (int j=0; 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 = 580879096216018200, L[60][150];
  vector <ll> V;
  for (int i=0; i<60; ++i) {
    for (int j=0; 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 << i << " " << V[j]-p << endl;
    if (L[i][V[j]-p]) x ^= (1LL<<i);
    p = V[j++]+1;
  }
  return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 154 ms 2832 KB Output is partially correct - L* = 19
2 Partially correct 144 ms 2624 KB Output is partially correct - L* = 20
3 Partially correct 146 ms 2676 KB Output is partially correct - L* = 20
4 Partially correct 151 ms 2664 KB Output is partially correct - L* = 17
5 Partially correct 149 ms 2664 KB Output is partially correct - L* = 16
6 Partially correct 143 ms 2704 KB Output is partially correct - L* = 16
7 Partially correct 150 ms 2688 KB Output is partially correct - L* = 19
8 Partially correct 144 ms 2832 KB Output is partially correct - L* = 15
9 Partially correct 145 ms 2684 KB Output is partially correct - L* = 16
10 Partially correct 151 ms 2684 KB Output is partially correct - L* = 16
11 Partially correct 145 ms 2684 KB Output is partially correct - L* = 19
12 Partially correct 143 ms 2788 KB Output is partially correct - L* = 20
13 Partially correct 142 ms 2676 KB Output is partially correct - L* = 18
14 Partially correct 144 ms 2692 KB Output is partially correct - L* = 19
15 Partially correct 154 ms 2676 KB Output is partially correct - L* = 18
16 Partially correct 143 ms 2676 KB Output is partially correct - L* = 20
17 Partially correct 144 ms 2672 KB Output is partially correct - L* = 16
18 Partially correct 151 ms 2944 KB Output is partially correct - L* = 20
19 Partially correct 144 ms 2968 KB Output is partially correct - L* = 17
20 Partially correct 144 ms 2684 KB Output is partially correct - L* = 19
21 Partially correct 155 ms 2676 KB Output is partially correct - L* = 20
22 Partially correct 145 ms 2740 KB Output is partially correct - L* = 20
23 Partially correct 144 ms 2776 KB Output is partially correct - L* = 15
24 Partially correct 150 ms 2936 KB Output is partially correct - L* = 17
25 Partially correct 145 ms 2684 KB Output is partially correct - L* = 16
26 Partially correct 144 ms 2816 KB Output is partially correct - L* = 19
27 Partially correct 145 ms 2596 KB Output is partially correct - L* = 20
28 Partially correct 144 ms 2840 KB Output is partially correct - L* = 16
29 Partially correct 145 ms 2816 KB Output is partially correct - L* = 17
30 Partially correct 144 ms 2724 KB Output is partially correct - L* = 20
31 Partially correct 144 ms 2692 KB Output is partially correct - L* = 18
32 Partially correct 143 ms 2680 KB Output is partially correct - L* = 19
33 Partially correct 144 ms 2688 KB Output is partially correct - L* = 16
34 Partially correct 143 ms 2632 KB Output is partially correct - L* = 16
35 Partially correct 144 ms 2676 KB Output is partially correct - L* = 17
36 Partially correct 145 ms 2980 KB Output is partially correct - L* = 16
37 Partially correct 144 ms 2680 KB Output is partially correct - L* = 17
38 Partially correct 143 ms 2816 KB Output is partially correct - L* = 19
39 Partially correct 145 ms 2672 KB Output is partially correct - L* = 19
40 Partially correct 144 ms 2824 KB Output is partially correct - L* = 20