Submission #1092842

# Submission time Handle Problem Language Result Execution time Memory
1092842 2024-09-25T08:39:55 Z irmuun Art Collections (BOI22_art) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#include "art.h"

using namespace std;

#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

void solve(int N){
    vector<int>R(N);
    vector<int>ans(N);
    for(int i=0;i<N;i++){
        R[i]=1;
        int cur=2;
        for(int j=0;j<N;j++){
            if(j!=i){
                R[j]=cur++;
            }
        }
        int A=publish(R);
        R[i]=N;
        cur=1;
        for(int j=0;j<N;j++){
            if(j!=i){
                R[j]=cur++;
            }
        }
        int B=publish(R);
        for(int x=0;x<N;x++){
            int y=(N-1)-x;
            if(x-y==A-B){
                ans[i]=x+1;
                break;
            }
        }
    }
    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 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -