제출 #1093035

#제출 시각아이디문제언어결과실행 시간메모리
1093035De3b0oArt Collections (BOI22_art)C++17
70 / 100
955 ms1844 KiB
#include "art.h"
#include<bits/stdc++.h>
#include<random>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define mid ((l+r)/2)
#define lc (2*x)
#define rc (2*x+1)

using namespace std;

ll a[4009];
ll ans[4009];

void solve(int N)
{
    ll n = N;
    vector<int> v;
    for(int i = 1 ; n>=i ; i++)
    {
        v.clear();
        v.pb(i);
        ll sum = 1;
        for(int j = 1 ; n>j ; j++)
        {
            if(j==i)
                sum++;
            v.pb(sum);
            sum++;
        }
        ll v1 = publish(v);
        v.clear();
        sum=1;
        for(int j = 1 ; n>j ; j++)
        {
            if(j==i)
                sum++;
            v.pb(sum);
            sum++;
        }
        v.pb(i);
        ll v2 = publish(v);
        ll r = (n+1+v1-v2)/2;
        ans[r]=i;
    }
    v.clear();
    for(int i = 1 ; n>=i ; i++)
        v.pb(ans[i]);
    answer(v);
}

컴파일 시 표준 에러 (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...