Submission #126530

# Submission time Handle Problem Language Result Execution time Memory
126530 2019-07-08T03:22:25 Z briansu Broken Device (JOI17_broken_device) C++14
51 / 100
46 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;
  	if(ct == 60 || i >= N - 2)d[i] = 0;
  	else if(v[i] && (!a || v[i + 1]) && (!b || v[i + 2]))d[i] = 1, d[i + 1] = a, d[i + 2] = b, i += 2, ct += 2, X >>= 2;
  	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 <<= 2, i += 2;
  }
  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 3016 KB Output is partially correct - L* = 20
2 Partially correct 39 ms 3056 KB Output is partially correct - L* = 20
3 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
4 Partially correct 40 ms 3056 KB Output is partially correct - L* = 23
5 Partially correct 40 ms 3000 KB Output is partially correct - L* = 21
6 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
7 Partially correct 40 ms 3056 KB Output is partially correct - L* = 20
8 Partially correct 40 ms 3064 KB Output is partially correct - L* = 21
9 Partially correct 40 ms 3064 KB Output is partially correct - L* = 20
10 Partially correct 40 ms 3064 KB Output is partially correct - L* = 23
11 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
12 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
13 Partially correct 40 ms 3056 KB Output is partially correct - L* = 23
14 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
15 Partially correct 39 ms 3056 KB Output is partially correct - L* = 23
16 Partially correct 41 ms 3056 KB Output is partially correct - L* = 21
17 Partially correct 41 ms 3056 KB Output is partially correct - L* = 20
18 Partially correct 40 ms 2984 KB Output is partially correct - L* = 22
19 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
20 Partially correct 39 ms 3056 KB Output is partially correct - L* = 22
21 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
22 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
23 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
24 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
25 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
26 Partially correct 41 ms 3024 KB Output is partially correct - L* = 21
27 Partially correct 40 ms 3056 KB Output is partially correct - L* = 23
28 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
29 Partially correct 40 ms 3000 KB Output is partially correct - L* = 23
30 Partially correct 41 ms 3056 KB Output is partially correct - L* = 23
31 Partially correct 40 ms 2856 KB Output is partially correct - L* = 21
32 Partially correct 46 ms 3056 KB Output is partially correct - L* = 23
33 Partially correct 41 ms 3312 KB Output is partially correct - L* = 20
34 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
35 Partially correct 40 ms 3056 KB Output is partially correct - L* = 23
36 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
37 Partially correct 40 ms 3056 KB Output is partially correct - L* = 20
38 Partially correct 40 ms 3056 KB Output is partially correct - L* = 22
39 Partially correct 40 ms 3056 KB Output is partially correct - L* = 21
40 Partially correct 40 ms 3000 KB Output is partially correct - L* = 21