제출 #712652

#제출 시각아이디문제언어결과실행 시간메모리
712652Mher777Art Collections (BOI22_art)C++17
100 / 100
1666 ms624 KiB
//////////////////////////////// Mher777
/* -------------------- Includes -------------------- */
#include <iostream>
#include <iomanip>
#include <array>
#include <string>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <list>
#include <iterator>
#include <numeric>
#include <complex>
#include <utility>
#include <random>
#include <fstream>
#include "art.h"
using namespace std;

typedef int itn;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef float fl;
typedef double db;

using vi = vector<int>;
using vll = vector<ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mpr make_pair
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define all(x) (x).begin(), (x).end()

const int MAX = int(1e9 + 5);
const ll MAXL = ll(1e18 + 5);
const ll MOD = ll(1e9 + 7);
const ll MOD2 = ll(998244353);

void solve(int n) {
	vector <int> v;
	vector <int> ans(n);
	for (int i = 1; i <= n; i++) v.pub(i);
	int cnt_prev = publish(v);
	for (int i = 1; i < n; i++) {
		int x = v[0];
		v.erase(v.begin());
		v.pub(x);
		int cnt_cur = publish(v);
		ans[(cnt_prev - cnt_cur + n - 1) / 2] = i;
		cnt_prev = cnt_cur;
	}
	for (int i = 0; i < n; i++) {
		if (ans[i] == 0) ans[i] = n;
	}
	answer(ans);
}

컴파일 시 표준 에러 (stderr) 메시지

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 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...
#Verdict Execution timeMemoryGrader output
Fetching results...