답안 #703936

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
703936 2023-03-01T03:58:02 Z Chal1shkan Art Collections (BOI22_art) C++17
0 / 100
0 ms 208 KB
# include <bits/stdc++.h>
# include "art.h"

# define pb push_back
# define ff first
# define ss second
# define nl "\n"
# define sz(x) ((int)(x).size())
# define deb(x) cerr << #x  << " = " << x << endl; 
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const ll maxn = 2e5 + 25;
const ll inf = 2e9 + 0;
const ll mod = 998244353;
const ll dx[] = {-1, 1, 0, 0};
const ll dy[] = {0, 0, -1, 1};
 
using namespace std;

int n, cnt1;

bool cmp (int x, int y)
{
	vector <int> v;
	for (int i = 1; i <= n; ++i)
	{
		v.pb(i);
	}
	swap(v[x - 1], v[y - 1]);
	int cnt2 = publish(v);
	if (cnt2 > cnt1)
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

void solve (int N)
{
	n = N;
	vector <int> v;
	for (int i = 1; i <= n; ++i) v.pb(i);
	cnt1 = publish(v);
	stable_sort(v.begin(), v.end(), cmp);
	answer(v);	
}

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) {
      |        ~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -