답안 #556423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
556423 2022-05-03T05:46:10 Z blue Broken Device (JOI17_broken_device) C++17
41 / 100
40 ms 2444 KB
#include "Annalib.h"
#include <vector>
#include <iostream>
using namespace std;

namespace
{
  using vi = vector<int>;
  using ll = long long;
}


void Anna( int N, long long X, int K, int P[] ){
  vi bit(60);
  // cerr << "X = " << X << '\n';
  for(int i = 0; i < 60; i++)
  {
    bit[i] = X%2;
    X /= 2;
  }

  // for(int z = 0; z < 60; z++)
  //   cerr << bit[z] << ' ';
  // cerr << "\n";

  vi bad(N, 0);
  for(int i = 0; i < K; i++)
    bad[P[i]] = 1;

  int cb = 0;

  vi encoded(N, 0);

  // for(int i = 0; i < N; i++)
  //   cerr << bad[i];
  // cerr << "\n";

  for(int i = 0; i+1 < N && cb < 60; i++)
  {
    if(!bad[i] && !bad[i+1])
    {
      // cerr << i << " : " << cb << '\n';
      encoded[i] = 1;
      encoded[i+1] = bit[cb];
      cb++;
      i++;
    }
  }

  // for(int i = 0; i < N; i++)
  //   cerr << encoded[i];
  // cerr << "\n";


  for(int i = 0; i < N; i++)
    Set(i, encoded[i]);
}
#include "Brunolib.h"
#include <vector>
using namespace std;

namespace
{
  using ll = long long;
  using vi = vector<int>;
}

long long Bruno( int N, int A[] )
{
  ll wt = 1;

  ll ans = 0;

  for(int i = 0; i+1 < N; i++)
  {
    if(A[i] == 1)
    {
      ans += wt*A[i+1];
      wt = wt+wt;
      i++;
    }
  }

  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 31 ms 2232 KB Output is partially correct - L* = 15
2 Partially correct 35 ms 2444 KB Output is partially correct - L* = 15
3 Partially correct 30 ms 2252 KB Output is partially correct - L* = 17
4 Partially correct 31 ms 2232 KB Output is partially correct - L* = 16
5 Partially correct 32 ms 2320 KB Output is partially correct - L* = 15
6 Partially correct 33 ms 2256 KB Output is partially correct - L* = 15
7 Partially correct 37 ms 2252 KB Output is partially correct - L* = 18
8 Partially correct 37 ms 2332 KB Output is partially correct - L* = 18
9 Partially correct 30 ms 2248 KB Output is partially correct - L* = 16
10 Partially correct 30 ms 2256 KB Output is partially correct - L* = 16
11 Partially correct 32 ms 2228 KB Output is partially correct - L* = 17
12 Partially correct 34 ms 2244 KB Output is partially correct - L* = 17
13 Partially correct 32 ms 2368 KB Output is partially correct - L* = 15
14 Partially correct 34 ms 2272 KB Output is partially correct - L* = 15
15 Partially correct 39 ms 2232 KB Output is partially correct - L* = 16
16 Partially correct 31 ms 2340 KB Output is partially correct - L* = 15
17 Partially correct 31 ms 2228 KB Output is partially correct - L* = 17
18 Partially correct 31 ms 2252 KB Output is partially correct - L* = 16
19 Partially correct 31 ms 2352 KB Output is partially correct - L* = 18
20 Partially correct 32 ms 2248 KB Output is partially correct - L* = 15
21 Partially correct 31 ms 2300 KB Output is partially correct - L* = 15
22 Partially correct 33 ms 2268 KB Output is partially correct - L* = 15
23 Partially correct 32 ms 2372 KB Output is partially correct - L* = 15
24 Partially correct 32 ms 2232 KB Output is partially correct - L* = 17
25 Partially correct 30 ms 2196 KB Output is partially correct - L* = 15
26 Partially correct 30 ms 2336 KB Output is partially correct - L* = 16
27 Partially correct 34 ms 2228 KB Output is partially correct - L* = 15
28 Partially correct 31 ms 2224 KB Output is partially correct - L* = 16
29 Partially correct 30 ms 2228 KB Output is partially correct - L* = 15
30 Partially correct 38 ms 2320 KB Output is partially correct - L* = 16
31 Partially correct 40 ms 2248 KB Output is partially correct - L* = 15
32 Partially correct 32 ms 2216 KB Output is partially correct - L* = 16
33 Partially correct 33 ms 2252 KB Output is partially correct - L* = 15
34 Partially correct 30 ms 2228 KB Output is partially correct - L* = 16
35 Partially correct 33 ms 2268 KB Output is partially correct - L* = 15
36 Partially correct 38 ms 2336 KB Output is partially correct - L* = 15
37 Partially correct 31 ms 2332 KB Output is partially correct - L* = 16
38 Partially correct 31 ms 2300 KB Output is partially correct - L* = 17
39 Partially correct 34 ms 2420 KB Output is partially correct - L* = 15
40 Partially correct 31 ms 2304 KB Output is partially correct - L* = 15