답안 #718817

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
718817 2023-04-05T00:10:53 Z Hacv16 Broken Device (JOI17_broken_device) C++17
0 / 100
2 ms 700 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

void Anna(int N, ll X, int K, int P[]){
    vector<bool> blocked(N);

    for(int i = 0; i < K; i++){
        int curBit = P[i];
        blocked[curBit] = true;
    }

    int numFree = 0;

    for(int i = 0; i < N; i++){
        if(!blocked[i]){ numFree++; continue; }

        if(numFree % 2) blocked[i - 1] = true;
        blocked[i] = true; numFree = 0;
    }

    vector<int> goodPos;

    for(int i = 0; i < N; i++){
        if(blocked[i]) Set(i, 0);
        else goodPos.push_back(i);
    }

    for(int i = 0, j = 0; i < goodPos.size(); i += 2, j++){
        int pos1 = goodPos[i], pos2 = goodPos[i + 1];
        Set(pos1, 1); Set(pos2, (bool)((1 << j) & X));
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

typedef long long ll;

ll Bruno(int N, int A[]){
  ll ans = 0;

  for(int i = 0, j = 0; i < N; i += 2){
    if(A[i] == 0) continue;
    ans |= (A[i + 1] << j); j++;
  }

  return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, ll, int, int*)':
Anna.cpp:31:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(int i = 0, j = 0; i < goodPos.size(); i += 2, j++){
      |                           ~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 696 KB Wrong Answer [2]
2 Incorrect 2 ms 700 KB Wrong Answer [2]
3 Incorrect 1 ms 696 KB Wrong Answer [2]
4 Incorrect 2 ms 664 KB Wrong Answer [2]
5 Incorrect 1 ms 664 KB Wrong Answer [2]
6 Incorrect 1 ms 688 KB Wrong Answer [2]
7 Incorrect 0 ms 680 KB Wrong Answer [2]
8 Incorrect 1 ms 696 KB Wrong Answer [2]
9 Incorrect 1 ms 688 KB Wrong Answer [2]
10 Incorrect 1 ms 680 KB Wrong Answer [2]
11 Incorrect 1 ms 696 KB Wrong Answer [2]
12 Incorrect 1 ms 696 KB Wrong Answer [2]
13 Incorrect 1 ms 688 KB Wrong Answer [2]
14 Incorrect 1 ms 688 KB Wrong Answer [2]
15 Incorrect 1 ms 696 KB Wrong Answer [2]
16 Incorrect 1 ms 696 KB Wrong Answer [2]
17 Incorrect 1 ms 688 KB Wrong Answer [2]
18 Incorrect 1 ms 696 KB Wrong Answer [2]
19 Incorrect 0 ms 688 KB Wrong Answer [2]
20 Incorrect 0 ms 696 KB Wrong Answer [2]
21 Incorrect 1 ms 688 KB Wrong Answer [2]
22 Incorrect 1 ms 668 KB Wrong Answer [2]
23 Incorrect 1 ms 688 KB Wrong Answer [2]
24 Incorrect 2 ms 628 KB Wrong Answer [2]
25 Incorrect 1 ms 688 KB Wrong Answer [2]
26 Incorrect 1 ms 688 KB Wrong Answer [2]
27 Incorrect 1 ms 656 KB Wrong Answer [2]
28 Incorrect 1 ms 696 KB Wrong Answer [2]
29 Incorrect 1 ms 684 KB Wrong Answer [2]
30 Incorrect 2 ms 688 KB Wrong Answer [2]
31 Incorrect 1 ms 688 KB Wrong Answer [2]
32 Incorrect 1 ms 688 KB Wrong Answer [2]
33 Incorrect 1 ms 668 KB Wrong Answer [2]
34 Incorrect 1 ms 688 KB Wrong Answer [2]
35 Incorrect 0 ms 688 KB Wrong Answer [2]
36 Incorrect 1 ms 696 KB Wrong Answer [2]
37 Incorrect 1 ms 688 KB Wrong Answer [2]
38 Incorrect 1 ms 684 KB Wrong Answer [2]
39 Incorrect 1 ms 696 KB Wrong Answer [2]
40 Incorrect 1 ms 688 KB Wrong Answer [2]