Submission #126534

# Submission time Handle Problem Language Result Execution time Memory
126534 2019-07-08T03:27:32 Z briansu Broken Device (JOI17_broken_device) C++14
45 / 100
40 ms 3312 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i = 0;i < n;i ++)

void Anna( int N, long long X, int K, int P[] ){
  vector<ll> v(N, 1);
  REP(i, K)v[P[i]] = 0;
  ll ct = 0;
  vector<ll> d(N, 0);
  REP(i, N)
  {
  	ll a = (X & 1) > 0;
  	ll b = (X & 2) > 0;
  	ll c = (X & 4) > 0;
  	if(ct == 60 || i >= N - 3)d[i] = 0;
  	else if(v[i] && (!a || v[i + 1]) && (!b || v[i + 2]) && (!c || v[i + 3]))d[i] = 1, d[i + 1] = a, d[i + 2] = b, d[i + 3] = c, i += 3, ct += 3, X >>= 3;
  	else d[i] = 0;
  }
  REP(i, N)Set(i, d[i]);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i = 0;i < n;i ++)

long long Bruno( int N, int A[] ){
  ll n = N;
  ll tt = 0, t = 1, fg = 0;
  REP(i, n)
  {
  	if(A[i])tt += t * A[i + 1] + (t * 2) * A[i + 2] + (t * 4) * A[i + 3], t <<= 3, i += 3;
  }
  return tt;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:9:21: warning: unused variable 'fg' [-Wunused-variable]
   ll tt = 0, t = 1, fg = 0;
                     ^~
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 3312 KB Output is partially correct - L* = 24
2 Partially correct 39 ms 3312 KB Output is partially correct - L* = 27
3 Partially correct 39 ms 3272 KB Output is partially correct - L* = 24
4 Partially correct 39 ms 3136 KB Output is partially correct - L* = 18
5 Partially correct 39 ms 3128 KB Output is partially correct - L* = 24
6 Partially correct 39 ms 3120 KB Output is partially correct - L* = 21
7 Partially correct 39 ms 3056 KB Output is partially correct - L* = 19
8 Partially correct 39 ms 3256 KB Output is partially correct - L* = 24
9 Partially correct 39 ms 3128 KB Output is partially correct - L* = 25
10 Partially correct 39 ms 3056 KB Output is partially correct - L* = 26
11 Partially correct 39 ms 3240 KB Output is partially correct - L* = 19
12 Partially correct 39 ms 3312 KB Output is partially correct - L* = 21
13 Partially correct 40 ms 3096 KB Output is partially correct - L* = 24
14 Partially correct 40 ms 3144 KB Output is partially correct - L* = 19
15 Partially correct 39 ms 3160 KB Output is partially correct - L* = 24
16 Partially correct 39 ms 3312 KB Output is partially correct - L* = 17
17 Partially correct 39 ms 3056 KB Output is partially correct - L* = 23
18 Partially correct 39 ms 3232 KB Output is partially correct - L* = 17
19 Partially correct 39 ms 3056 KB Output is partially correct - L* = 23
20 Partially correct 39 ms 3280 KB Output is partially correct - L* = 24
21 Partially correct 39 ms 3168 KB Output is partially correct - L* = 24
22 Partially correct 39 ms 3056 KB Output is partially correct - L* = 24
23 Partially correct 39 ms 3048 KB Output is partially correct - L* = 21
24 Partially correct 39 ms 3056 KB Output is partially correct - L* = 23
25 Partially correct 40 ms 3088 KB Output is partially correct - L* = 26
26 Partially correct 39 ms 3256 KB Output is partially correct - L* = 23
27 Partially correct 39 ms 3224 KB Output is partially correct - L* = 25
28 Partially correct 39 ms 3152 KB Output is partially correct - L* = 20
29 Partially correct 39 ms 3264 KB Output is partially correct - L* = 23
30 Partially correct 39 ms 3056 KB Output is partially correct - L* = 24
31 Partially correct 40 ms 3224 KB Output is partially correct - L* = 24
32 Partially correct 39 ms 3056 KB Output is partially correct - L* = 18
33 Partially correct 39 ms 3184 KB Output is partially correct - L* = 17
34 Partially correct 39 ms 3056 KB Output is partially correct - L* = 24
35 Partially correct 39 ms 3144 KB Output is partially correct - L* = 24
36 Partially correct 39 ms 3048 KB Output is partially correct - L* = 20
37 Partially correct 39 ms 3064 KB Output is partially correct - L* = 20
38 Partially correct 39 ms 3056 KB Output is partially correct - L* = 20
39 Partially correct 39 ms 3088 KB Output is partially correct - L* = 21
40 Partially correct 39 ms 3256 KB Output is partially correct - L* = 25