Submission #1282747

#TimeUsernameProblemLanguageResultExecution timeMemory
1282747theiuliusPark (JOI17_park)C++20
Compilation error
0 ms0 KiB
#include "park.h" #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back int p[1502] = {}; void Detect(int T, int N){ int t = T, n = N, m = M; int mez[n + 1] = {1}; vector<int> v[10] = {}; v[0].pb(0); for (int k = 1; k <= 8; k++){ for (int i = 1; i < n; i++){ // graphs vpoulobt simagleebis mixedvit if (mez[i]){ continue; } mez[i] = 1; if (Ask(0, i, mez)){ v[k].pb(i); } mez[i] = 0; } for (auto h : v[k]){ mez[h] = 1; } } for (auto h : v[1]){ cout << h << " " << 0 << endl; Answer(0, h); p[h] = 0; } for (int k = 2; k <= 8; k++){ for (auto h : v[k]){ int l = 0, r = v[k - 1].size() - 1, ans = r; while (l <= r){ int mid = (l + r) / 2; int a[n] = {}; a[h] = 1; a[0] = 1; for (int i = l; i <= mid; i++){ // FILL int x = v[k - 1][i]; while (x != 0){ a[x] = 1; x = p[x]; } } int s = Ask(0, h, a); if (s){ r = mid - 1; ans = mid; }else{ l = mid + 1; } } p[h] = v[k - 1][ans]; cout << h << " " << v[k - 1][ans] << endl; Answer(min(h, v[k - 1][ans]), max(h, v[k - 1][ans])); } } }

Compilation message (stderr)

park.cpp: In function 'void Detect(long long int, long long int)':
park.cpp:10:27: error: 'M' was not declared in this scope
   10 |     int t = T, n = N, m = M;
      |                           ^
park.cpp:22:27: error: cannot convert 'long long int*' to 'int*'
   22 |             if (Ask(0, i, mez)){
      |                           ^~~
      |                           |
      |                           long long int*
In file included from park.cpp:1:
park.h:1:29: note:   initializing argument 3 of 'int Ask(int, int, int*)'
    1 | int Ask(int A , int B , int Place[]);
      |                         ~~~~^~~~~~~
park.cpp:56:35: error: cannot convert 'long long int*' to 'int*'
   56 |                 int s = Ask(0, h, a);
      |                                   ^
      |                                   |
      |                                   long long int*
park.h:1:29: note:   initializing argument 3 of 'int Ask(int, int, int*)'
    1 | int Ask(int A , int B , int Place[]);
      |                         ~~~~^~~~~~~