Submission #296184

#TimeUsernameProblemLanguageResultExecution timeMemory
296184BTheroPark (JOI17_park)C++17
10 / 100
76 ms384 KiB
// chrono::system_clock::now().time_since_epoch().count()
#include "park.h"
#include<bits/stdc++.h>

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << endl;

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

namespace {
  int subtask_no, n;
  
  bool ask(int a, int b, vector<int> &vec) {
    if (a > b) {
      swap(a, b);
    }
  
    int tmp[n];
    fill(tmp, tmp + n, 0);
    
    for (int x : vec) {
      tmp[x] = 1;
    }
    
    return Ask(a, b, tmp);
  }
  
  void report(int a, int b) {
    Answer(a, b);
  }
  
  void solve() {
    for (int a = 0; a < n; ++a) {
      for (int b = a + 1; b < n; ++b) {
        vector<int> S;
        S.pb(a);
        S.pb(b);
      
        if (ask(a, b, S)) {
          report(a, b);
        }
      }
    }
  }
};

void Detect(int T, int N) {
  subtask_no = T;
  n = N;
  solve();
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...