답안 #914099

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
914099 2024-01-21T04:01:23 Z Alphanumeric Coreputer (IOI23_coreputer) C++17
컴파일 오류
0 ms 0 KB
/*
⣿⣿⡿⣫⣾⠏⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⣀⣀⣀⣀⠄⠄⠄⠄⠄⠄
⣿⡇⠱⠉⠁⠄⠄⠄⠄⠄⠄⢀⣀⣤⣶⣶⣿⣿⣿⣿⣿⣿⣿⣦⠄⠄⠄⠄⠄
⣿⡇⠄⠄⠄⠄⠄⢀⣠⣛⡩⣩⣭⡹⣿⣿⣿⣿⠞⣛⣛⣛⡲⣿⡇⠄⠄⠄⠄
⣿⡇⠄⠄⠄⡾⣡⣾⣿⣷⣹⣿⣿⡿⣪⡻⠟⣱⣿⣿⣿⣿⣿⣷⡹⠄⠄⠄⠄
⣿⡇⠄⠄⣼⡇⣿⣻⣿⠟⡛⢿⣿⣾⣿⡇⢰⣍⢻⡿⠛⢿⣿⡭⣿⣷⠄⠄⠄
⣿⣧⣄⡀⣿⡇⣮⣽⣿⣮⣉⣾⣿⣿⣿⣇⡸⣿⣿⣆⠛⣰⣿⣾⡿⣿⠄⠄⠄
⣿⣇⡼⣄⣿⣿⡄⠙⢿⣏⣿⣿⡮⠁⣉⣾⣷⡈⠃⢿⣿⣬⡭⠝⣀⣿⠄⠄⠐
⡆⡇⣹⣿⣿⣿⣿⡿⠓⠛⣉⣉⣉⣉⣙⣛⠓⠾⣟⢿⣿⣿⣿⣿⣿⣿⣿⠇⠄⠙
⠁⡇⣞⣿⡿⠋⠁⠄⠄⠈⠉⠙⠛⠛⠻⠿⠿⠿⣶⣌⠻⣿⣿⣿⣿⣿⢗⢴⣆⢣
⠸⣇⡻⠈⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⢻⣷⡌⢿⣿⣿⣿⢸⠼⣣⣾
⣦⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⠄⠄⠄⠄⠄⠄⠄⠄⠙⠛⠈⣿⡫⡼⢠⣾⣿⣿
⣿⣇⠄⣀⣠⡀⠄⠄⠴⠾⠿⠿⠶⠶⣦⣤⡀⠄⠄⠄⠄⠄⠄⢨⠯⢁⣿⣿⣿⣿
⣿⣿⣦⢒⠤⣅⡶⣶⣶⣾⣿⣿⣿⣷⣶⣮⣍⠢⠄⠄⠄⠄⠄⠐⢠⣾⣿⣿⣿⣿
⣿⣿⣿⣧⡐⠫⣉⡿⣬⡞⢿⣿⢯⠽⣶⡽⢟⣛⢖⣨⣛⠛⢃⣴⣿⣿⣿⣿⣿⣿
*/

// beichen is a classic problem in china
// map<pair<int,pair<int,int>>,priority_queue<pair<int, pair<int,int>>, vector<pair<int, pair<int,int>>>, greater<pair<int, pair<int,int>>>>> m;
// ^^ useless ds for good luck

#include "coreputer.h"

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzworks,popworks")

using namespace std;
#define int long long

#define inp(arr) \
  for (auto &it : arr) cin >> it;
#define outp(arr) \
  for (auto it : arr) cout << it << " ";
#define inppair(arr) \
  for (pair<int, int> & it : arr) cin >> it.first >> it.second;
#define outppair(arr) \
  for (pair<int, int> it : arr) cout << it.first << " " << it.second << "\n";
#define for0(n) for (int i = 0; i < n; ++i)
#define for0j(n) for (int j = 0; j < n; ++j)
#define for0k(n) for (int k = 0; k < n; ++k)
#define for1(n) for (int i = 1; i <= n; ++i)
#define for1j(n) for (int j = 1; j <= n; ++j)
#define for1k(n) for (int k = 1; k <= n; ++k)
#define for1b(n) for (int i = n; i > 0; --i)
#define for1bj(n) for (int j = n; j > 0; --j)
#define for0b(n) for (int i = n - 1; i >= 0; --i)
#define for0bj(n) for (int j = n - 1; j >= 0; --j)
#define forself(start, end) for (int i = start; i < end; ++i)
#define vecall(v) v.begin(), v.end()
#define srt(arr) sort(arr, arr + (sizeof(arr) / sizeof(arr[0])))
#define srtvc(arr) sort(arr.begin(), arr.end())
#define bcsrt(arr) sort(arr, arr + (sizeof(arr) / sizeof(arr[0])), greater<int>())
#define bcsrtvc(arr) sort(arr.begin(), arr.end(), greater<int>())
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define pq priority_queue
#define pii pair<int, int>
#define bkpqi priority_queue<int, vector<int>, greater<int>>
#define bkpqpii priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
#define setzero(arr) memset(arr, 0, sizeof(arr));
#define setone(arr) memset(arr, 1, sizeof(arr));
#define setneg(arr) memset(arr, -1, sizeof(arr));

const int mod1 = 998244353;
const int mod2 = 1000000007;

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ordered_multiset tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>

vector<int> malfunctioning_cores(int n) {
  vector<int> a(n, 0);
  bool even = 0;
  int l = 0, r = n - 1;
  while (l + 1 < r) {
    vector<int> v;
    int mid = (l + r) / 2;
    for0(mid + 1) {
      v.pub(i);
    }
    int temp = run_diagnostic(v);
    if (temp == 0) {
      even = 1;
    }
    if (temp >= 0) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (l == 0) {
    if (!even) {
      a[0] = 1;
      return a;
    }
    vector<int> temp;
    temp.pub(0);
    a[0] = 1;
    for (int i = 1; i < n - 1; i++) {
      temp.pub(i);
      int t = run_diagnostic(temp);
      if (t == 1) {
        a[i] = 1;
        return a;
      }
      temp.pob();
    }
    a[n - 1] = 1;
    return a;
  }
  a[l] = 1;
  int tot = 1;
  vector<int> temp;
  for (int i = 0; i <= l - (!even); i++) {
    temp.pb(i);
  }
  for (int i = l + 1; i < n; i++) {
    temp.pb(i);
    int temp = run_diagnostic(temp);
    if (temp == 1) {
      a[i] = 1;
      tot++;
    }
    temp.pob();
  }
  temp.clear();
  for (int i = l + 1; i < n; i++) {
    temp.pb(i);
  }
  for (int i = 1; i < l; i++) {
    temp.pub(i);
    int temp = run_diagnostic(temp);
    if (temp == 1) {
      a[i] = 1;
      tot++;
    }
    temp.pob();
  }
  if (tot % 2 == even) {
    a[0] = 1;
  }
  return a;
}

Compilation message

coreputer.cpp: In function 'std::vector<long long int> malfunctioning_cores(long long int)':
coreputer.cpp:88:31: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   88 |     int temp = run_diagnostic(v);
      |                               ^
      |                               |
      |                               vector<long long int>
coreputer.cpp:108:30: error: could not convert 'temp' from 'vector<long long int>' to 'vector<int>'
  108 |       int t = run_diagnostic(temp);
      |                              ^~~~
      |                              |
      |                              vector<long long int>
coreputer.cpp:122:10: error: 'class std::vector<long long int>' has no member named 'pb'
  122 |     temp.pb(i);
      |          ^~
coreputer.cpp:125:10: error: 'class std::vector<long long int>' has no member named 'pb'
  125 |     temp.pb(i);
      |          ^~
coreputer.cpp:126:31: error: could not convert 'temp' from 'long long int' to 'std::vector<int>'
  126 |     int temp = run_diagnostic(temp);
      |                               ^~~~
      |                               |
      |                               long long int
coreputer.cpp:61:13: error: request for member 'pop_back' in 'temp', which is of non-class type 'long long int'
   61 | #define pob pop_back
      |             ^~~~~~~~
coreputer.cpp:131:10: note: in expansion of macro 'pob'
  131 |     temp.pob();
      |          ^~~
coreputer.cpp:135:10: error: 'class std::vector<long long int>' has no member named 'pb'
  135 |     temp.pb(i);
      |          ^~
coreputer.cpp:139:31: error: could not convert 'temp' from 'long long int' to 'std::vector<int>'
  139 |     int temp = run_diagnostic(temp);
      |                               ^~~~
      |                               |
      |                               long long int
coreputer.cpp:61:13: error: request for member 'pop_back' in 'temp', which is of non-class type 'long long int'
   61 | #define pob pop_back
      |             ^~~~~~~~
coreputer.cpp:144:10: note: in expansion of macro 'pob'
  144 |     temp.pob();
      |          ^~~