Submission #993542

# Submission time Handle Problem Language Result Execution time Memory
993542 2024-06-06T02:44:45 Z abczz Magic Show (APIO24_show) C++17
0 / 100
2 ms 1328 KB
#include <vector>
#include "Alice.h"
#include <iostream>
#include <random>
#include <algorithm>
#define ll long long

using namespace std;

std::vector<std::pair<int,int>> Alice(){
    mt19937_64 mt(69);
    vector <pair<int, int>> edges;
    vector <ll> perm;
    ll n = 5000;
    ll x = setN(5000);
    ll mx = 0;
    for (int i=3; i<=n; ++i) {
        perm.push_back(i);
    }
    shuffle(perm.begin(), perm.end(), mt);
    edges.push_back({1, 2});
    for (int i=0; i<60; ++i) {
        for (int j=i*83; j<(i+1)*83; ++j) {
            edges.push_back({(x & 1) + 1, perm[j]});
            mx = max(mx, (ll)j);
        }
        x /= 2;
    }
    for (int i=mx+1; i<perm.size(); ++i) {
        edges.push_back({1, perm[i]});
    }
    shuffle(edges.begin(), edges.end(), mt);
    return edges;
}
#include <vector>
#include "Bob.h"
#include <iostream>
#include <random>
#include <algorithm>
#define ll long long

using namespace std;

long long Bob(std::vector<std::pair<int,int>> V){
	mt19937_64 mt(69);
    vector <ll> perm;
    ll n = 5000, X[5001], k = 1, f = 0;
    for (int i=3; i<=n; ++i) {
        X[i] = -1;
        perm.push_back(i);
    }
    shuffle(perm.begin(), perm.end(), mt);
    for (auto [a, b] : V) {
        X[b] = a;
    }
    for (int i=0; i<60; ++i) {
        ll bit = 0;
        for (int j=i*83; j<(i+1)*83; ++j) {
            if (X[perm[j]] != -1) bit = X[perm[j]]-1;
        }
        //cout << bit;
        f += bit * k;
        k *= 2;
    }
    //cout << endl;
    return f;
}

Compilation message

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:29:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for (int i=mx+1; i<perm.size(); ++i) {
      |                      ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1316 KB Correct.
2 Incorrect 2 ms 1328 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1316 KB Correct.
2 Incorrect 2 ms 1328 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1316 KB Correct.
2 Incorrect 2 ms 1328 KB Incorrect answer.
3 Halted 0 ms 0 KB -