답안 #70565

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70565 2018-08-23T06:15:34 Z Talant Broken Device (JOI17_broken_device) C++17
0 / 100
63 ms 3952 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 ++;
                  while (i + 1 < n && s[ind - 1] == '1' && s[ind] == '1' && ind < (int)s.size() && u[i + 1] == 0) {
                        Set(i + 1,(int)(s[ind] - '0'));
                        ind ++;
                        i ++;
                  }
                  i ++;
                  if (i < n)
                        Set(i,0);
            }
            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];
//                  cout << i + 1 << endl;
                  cnt ++;
                  i ++;
                  while (a[i] == 1 && a[i + 1] == 1 && i + 1 < N) {
                        ans += (1ll << cnt) * 1ll *  a[i + 1];
//                        cout << i + 1 << endl;
                        cnt ++;
                        i ++;
                  }
            }
      }
      return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 46 ms 3368 KB Output isn't correct - L* = 0
3 Incorrect 53 ms 3368 KB Output isn't correct - L* = 0
4 Incorrect 61 ms 3472 KB Output isn't correct - L* = 0
5 Incorrect 51 ms 3512 KB Output isn't correct - L* = 0
6 Incorrect 60 ms 3592 KB Output isn't correct - L* = 0
7 Incorrect 46 ms 3592 KB Output isn't correct - L* = 0
8 Incorrect 52 ms 3592 KB Output isn't correct - L* = 0
9 Incorrect 49 ms 3592 KB Output isn't correct - L* = 0
10 Incorrect 55 ms 3592 KB Output isn't correct - L* = 0
11 Incorrect 48 ms 3592 KB Output isn't correct - L* = 0
12 Incorrect 56 ms 3592 KB Output isn't correct - L* = 0
13 Incorrect 63 ms 3616 KB Output isn't correct - L* = 0
14 Incorrect 62 ms 3616 KB Output isn't correct - L* = 0
15 Incorrect 49 ms 3616 KB Output isn't correct - L* = 0
16 Incorrect 46 ms 3616 KB Output isn't correct - L* = 0
17 Incorrect 48 ms 3616 KB Output isn't correct - L* = 0
18 Incorrect 48 ms 3616 KB Output isn't correct - L* = 0
19 Incorrect 50 ms 3736 KB Output isn't correct - L* = 0
20 Incorrect 56 ms 3736 KB Output isn't correct - L* = 0
21 Incorrect 60 ms 3736 KB Output isn't correct - L* = 0
22 Incorrect 48 ms 3736 KB Output isn't correct - L* = 0
23 Incorrect 45 ms 3736 KB Output isn't correct - L* = 0
24 Incorrect 54 ms 3736 KB Output isn't correct - L* = 0
25 Incorrect 53 ms 3736 KB Output isn't correct - L* = 0
26 Incorrect 45 ms 3736 KB Output isn't correct - L* = 0
27 Incorrect 51 ms 3736 KB Output isn't correct - L* = 0
28 Incorrect 44 ms 3736 KB Output isn't correct - L* = 0
29 Incorrect 46 ms 3736 KB Output isn't correct - L* = 0
30 Incorrect 46 ms 3736 KB Output isn't correct - L* = 0
31 Incorrect 56 ms 3736 KB Output isn't correct - L* = 0
32 Incorrect 46 ms 3736 KB Output isn't correct - L* = 0
33 Incorrect 47 ms 3736 KB Output isn't correct - L* = 0
34 Incorrect 46 ms 3736 KB Output isn't correct - L* = 0
35 Incorrect 45 ms 3736 KB Output isn't correct - L* = 0
36 Incorrect 55 ms 3736 KB Output isn't correct - L* = 0
37 Incorrect 46 ms 3736 KB Output isn't correct - L* = 0
38 Incorrect 55 ms 3736 KB Output isn't correct - L* = 0
39 Incorrect 49 ms 3736 KB Output isn't correct - L* = 0
40 Incorrect 62 ms 3952 KB Output isn't correct - L* = 0