Submission #70023

# Submission time Handle Problem Language Result Execution time Memory
70023 2018-08-22T09:21:22 Z Talant Broken Device (JOI17_broken_device) C++17
41 / 100
76 ms 6656 KB
#include "Annalib.h"

#include <bits/stdc++.h>

#define sc second
#define fr first
#define pb push_back
#define mk make_pair

using namespace std;

string bin(long long x) {
      string a = "";
      while(x) {
            a += (char)(x % 2 + '0');
            x /= 2;
      }
      return a;
}
int u[200];
int ind;

void Anna( int n, long long x, int k, int p[] ){
      string s = bin(x);
      memset(u,0,sizeof(u));
      ind = 0;

      for (int i = 0; i < k; i ++)
            u[p[i]] = 1;

      for (int i = 0; i < n; i ++) {
            if (ind >= (int)s.size()) {
                  Set(i,0);
                  continue;
            }
            if (i + 1 < n && u[i] + u[i + 1] < 1) {
                  Set(i,1);
                  Set(i + 1,(int)(s[ind] - '0'));
                  ind ++;
                  i ++;
            }
            else {
                  Set(i,0);
            }
      }
}
#include "Brunolib.h"

#include <bits/stdc++.h>

#define sc second
#define fr first
#define pb push_back
#define mk make_pair

using namespace std;

long long ans;
long long cnt;

long long Bruno( int N, int a[] ){
      ans = 0;
      cnt = 0;

      for (int i = 0; i < N - 1; i ++) {
            if (a[i] == 1) {
                  ans += (1ll << cnt) * 1ll *  a[i + 1];
                  cnt ++;
                  i ++;
            }
      }
      return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 55 ms 3056 KB Output is partially correct - L* = 15
2 Partially correct 55 ms 3432 KB Output is partially correct - L* = 15
3 Partially correct 62 ms 3936 KB Output is partially correct - L* = 17
4 Partially correct 58 ms 4488 KB Output is partially correct - L* = 16
5 Partially correct 46 ms 4528 KB Output is partially correct - L* = 15
6 Partially correct 43 ms 5032 KB Output is partially correct - L* = 15
7 Partially correct 47 ms 5160 KB Output is partially correct - L* = 18
8 Partially correct 44 ms 5408 KB Output is partially correct - L* = 18
9 Partially correct 64 ms 5656 KB Output is partially correct - L* = 16
10 Partially correct 51 ms 6160 KB Output is partially correct - L* = 16
11 Partially correct 61 ms 6400 KB Output is partially correct - L* = 17
12 Partially correct 59 ms 6400 KB Output is partially correct - L* = 17
13 Partially correct 61 ms 6400 KB Output is partially correct - L* = 15
14 Partially correct 46 ms 6400 KB Output is partially correct - L* = 15
15 Partially correct 44 ms 6400 KB Output is partially correct - L* = 16
16 Partially correct 52 ms 6400 KB Output is partially correct - L* = 15
17 Partially correct 47 ms 6400 KB Output is partially correct - L* = 17
18 Partially correct 50 ms 6400 KB Output is partially correct - L* = 16
19 Partially correct 63 ms 6400 KB Output is partially correct - L* = 18
20 Partially correct 50 ms 6656 KB Output is partially correct - L* = 15
21 Partially correct 44 ms 6656 KB Output is partially correct - L* = 15
22 Partially correct 62 ms 6656 KB Output is partially correct - L* = 15
23 Partially correct 55 ms 6656 KB Output is partially correct - L* = 15
24 Partially correct 48 ms 6656 KB Output is partially correct - L* = 17
25 Partially correct 51 ms 6656 KB Output is partially correct - L* = 15
26 Partially correct 45 ms 6656 KB Output is partially correct - L* = 16
27 Partially correct 46 ms 6656 KB Output is partially correct - L* = 15
28 Partially correct 47 ms 6656 KB Output is partially correct - L* = 16
29 Partially correct 45 ms 6656 KB Output is partially correct - L* = 15
30 Partially correct 49 ms 6656 KB Output is partially correct - L* = 16
31 Partially correct 44 ms 6656 KB Output is partially correct - L* = 15
32 Partially correct 47 ms 6656 KB Output is partially correct - L* = 16
33 Partially correct 66 ms 6656 KB Output is partially correct - L* = 15
34 Partially correct 59 ms 6656 KB Output is partially correct - L* = 16
35 Partially correct 54 ms 6656 KB Output is partially correct - L* = 15
36 Partially correct 62 ms 6656 KB Output is partially correct - L* = 15
37 Partially correct 64 ms 6656 KB Output is partially correct - L* = 16
38 Partially correct 76 ms 6656 KB Output is partially correct - L* = 17
39 Partially correct 54 ms 6656 KB Output is partially correct - L* = 15
40 Partially correct 59 ms 6656 KB Output is partially correct - L* = 15