답안 #231533

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
231533 2020-05-13T22:14:31 Z cstuart Broken Device (JOI17_broken_device) C++17
75 / 100
56 ms 3328 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] = {"100110010101011010010110010110101010010110011010100110100101100110100101100101100101101010100101011001010101010110101001100101101001010110100110100101", "011001101010100101101001101001010101101001100101011001011010011001011010011010011010010101011010100110101010101001010110011010010110101001011001011010", "000010000100100000100000100100010000010000100000100100010000000100100010000100000100000100010000100001000100000000100010001000000110000010000001010000", "111011011110111111011111010111111011101110111011111011101111111011101111101111011011111011111011111011101111101111011101110111111011110011110111111110"};
  
  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] = {"100110010101011010010110010110101010010110011010100110100101100110100101100101100101101010100101011001010101010110101001100101101001010110100110100101", "011001101010100101101001101001010101101001100101011001011010011001011010011010011010010101011010100110101010101001010110011010010110101001011001011010", "000010000100100000100000100100010000010000100000100100010000000100100010000100000100000100010000100001000100000000100010001000000110000010000001010000", "111011011110111111011111010111111011101110111011111011101111111011101111101111011011111011111011111011101111101111011101110111111011110011110111111110"};
  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;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 47 ms 3072 KB Output is partially correct - L* = 39
2 Partially correct 47 ms 3072 KB Output is partially correct - L* = 38
3 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
4 Partially correct 46 ms 3072 KB Output is partially correct - L* = 39
5 Partially correct 56 ms 3128 KB Output is partially correct - L* = 37
6 Partially correct 47 ms 3072 KB Output is partially correct - L* = 37
7 Partially correct 47 ms 3072 KB Output is partially correct - L* = 38
8 Partially correct 48 ms 3056 KB Output is partially correct - L* = 37
9 Partially correct 48 ms 3072 KB Output is partially correct - L* = 38
10 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
11 Partially correct 47 ms 3072 KB Output is partially correct - L* = 38
12 Partially correct 46 ms 3072 KB Output is partially correct - L* = 39
13 Partially correct 47 ms 3072 KB Output is partially correct - L* = 37
14 Partially correct 47 ms 3072 KB Output is partially correct - L* = 37
15 Partially correct 46 ms 3072 KB Output is partially correct - L* = 37
16 Partially correct 47 ms 3056 KB Output is partially correct - L* = 35
17 Partially correct 49 ms 3056 KB Output is partially correct - L* = 39
18 Partially correct 47 ms 3056 KB Output is partially correct - L* = 38
19 Partially correct 48 ms 3072 KB Output is partially correct - L* = 38
20 Partially correct 47 ms 3056 KB Output is partially correct - L* = 38
21 Partially correct 51 ms 2944 KB Output is partially correct - L* = 37
22 Partially correct 47 ms 3072 KB Output is partially correct - L* = 39
23 Partially correct 49 ms 3072 KB Output is partially correct - L* = 32
24 Partially correct 49 ms 3072 KB Output is partially correct - L* = 38
25 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
26 Partially correct 47 ms 3072 KB Output is partially correct - L* = 37
27 Partially correct 51 ms 3072 KB Output is partially correct - L* = 39
28 Partially correct 48 ms 3064 KB Output is partially correct - L* = 38
29 Partially correct 46 ms 3072 KB Output is partially correct - L* = 37
30 Partially correct 47 ms 3072 KB Output is partially correct - L* = 38
31 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
32 Partially correct 47 ms 3072 KB Output is partially correct - L* = 34
33 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
34 Partially correct 47 ms 3056 KB Output is partially correct - L* = 39
35 Partially correct 46 ms 3072 KB Output is partially correct - L* = 37
36 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
37 Partially correct 49 ms 3056 KB Output is partially correct - L* = 38
38 Partially correct 47 ms 3328 KB Output is partially correct - L* = 38
39 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
40 Partially correct 48 ms 3056 KB Output is partially correct - L* = 38