Submission #1038127

# Submission time Handle Problem Language Result Execution time Memory
1038127 2024-07-29T13:16:20 Z serifefedartar Art Collections (BOI22_art) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#include "art.h"
using namespace std;

#define fast ios::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
#define f first
#define s second
#define LOGN 20
const ll MOD = 1e9 + 7;
const ll MAXN = 1e6 + 100;

void solve(int N) {
    vector<int> X;
    for (int i = 1; i <= N; i++)
        X.push_back(i);

    int base = publish(X);
    sort(X.begin(), X.end(), [&](int A, int B) {
        vector<int> Y;
        for (int i = 1; i <= N; i++)
            Y.push_back(i);
        Y[A-1] = B;
        Y[B-1] = A;
        int q = publish(X);
        if (A < B)
            return q > base;
        else
            return q < base;
    });

    answer(X);
}

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 -