Submission #576656

# Submission time Handle Problem Language Result Execution time Memory
576656 2022-06-13T08:57:33 Z jiahng Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include "art.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define ll int
// #define int ll
typedef pair<int32_t, int32_t> pi;
typedef vector <int> vi;
typedef vector <pi> vpi;
typedef pair<pi, ll> pii;
typedef set <ll> si;
typedef long double ld;
#define f first
#define s second
#define mp make_pair
#define FOR(i,s,e) for(int i=s;i<=int(e);++i)
#define DEC(i,s,e) for(int i=s;i>=int(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define maxn 120001
#define INF 1e9
#define MOD 1000000007
typedef pair <vi, int> pvi;
typedef pair <int,pi> ipi;
typedef vector <pii> vpii;

int sm[maxn], diff[maxn];
void solve(int N) {
  vi v;

  FOR(i,1,N) v.pb(i);
  int x = publish(v);
  diff[N] = 0;
  FOR(i,1,N-1){
          vi v;
          FOR(j,1,i-1) v.pb(j);
          FOR(j,i+1,N) v.pb(j);
          v.pb(i);
          diff[i] = publish(v) - x;
  }
  vi ans;
  FOR(i,1,N){
          int num_big = (N-i+diff[i]) / 2;
          int num_small = (N-i-num_big);
          cout << num_small << ' ';
          ans.pb(v[num_small]);
          v.erase(v.begin() + num_small);
  }
  answer(ans);
}

Compilation message

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Security violation!
2 Halted 0 ms 0 KB -