Submission #549888

#TimeUsernameProblemLanguageResultExecution timeMemory
549888BalintRFlights (JOI22_flights)C++17
0 / 100
1 ms528 KiB
#include <bits/stdc++.h>
using namespace std;
#include "Ali.h"

typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef complex<double> cmplx;
template <typename T> using minPq = priority_queue<T, vector<T>, greater<T>>;
#define boost() cin.sync_with_stdio(0); cin.tie(0)
#define ms(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define fs first
#define sn second
#define ALL(v) (v).begin(), (v).end()
#define SZ(v) ((int) (v).size())
#define lbv(v, x) (lower_bound((v).begin(), (v).end(), x) - (v).begin())
#define ubv(v, x) (upper_bound((v).begin(), (v).end(), x) - (v).begin())
template <typename T> inline void UNIQUE(vector<T> &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
#define FR(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define dbg(x) {cout << #x << ' ' << x << endl;}
#define dbgArr(arr, n) {cout << #arr; FR(_i, n) cout << ' ' << arr[_i]; cout << endl;}

const int MN = 1e4;
const int HALF = 100;
int n;
vi adjList[MN];
int dist[MN];

void Init(int N, vi U, vi V){
    n = N;
    FR(i, n){
        int a = U[i], b = V[i];
        adjList[a].pb(b);
        adjList[b].pb(a);
    }
    FR(i, n){
        SetID(i, i);
    }
}

void dfs(int n1, int par){
    for(int n2 : adjList[n1]){
        if(n2 != par){
            dist[n2] = dist[n1] + 1;
            dfs(n2, n1);
        }
    }
}

string SendA(string inStr){
    assert(SZ(inStr) == 20);
    int val = 0;
    FR(i, 20) val |= (inStr[i]-'0') << i;
    int nodeA = val % MN;
    int nodeB = val/MN;

    dist[nodeA] = 0;
    dfs(nodeA, -1);
    string res;
    FR(i, HALF){
        int v = dist[nodeB*HALF + i];
        FR(j, 14) res.pb((v >> j) & 1 ? '1' : '0');
    }

    FR(i, n) adjList[i].clear();
    return res;
}
#include <bits/stdc++.h>
using namespace std;
#include "Benjamin.h"

typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef complex<double> cmplx;
template <typename T> using minPq = priority_queue<T, vector<T>, greater<T>>;
#define boost() cin.sync_with_stdio(0); cin.tie(0)
#define ms(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define fs first
#define sn second
#define ALL(v) (v).begin(), (v).end()
#define SZ(v) ((int) (v).size())
#define lbv(v, x) (lower_bound((v).begin(), (v).end(), x) - (v).begin())
#define ubv(v, x) (upper_bound((v).begin(), (v).end(), x) - (v).begin())
template <typename T> inline void UNIQUE(vector<T> &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
#define FR(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define dbg(x) {cout << #x << ' ' << x << endl;}
#define dbgArr(arr, n) {cout << #arr; FR(_i, n) cout << ' ' << arr[_i]; cout << endl;}

const int MN = 1e4;
const int HALF = 100;
int n, x, y;

string SendB(int N, int X, int Y){
    n = N;
    x = X;
    y = Y;
    int v = x + MN*(y/HALF);
    string res;
    FR(i, 20) res.pb((v >> i) & 1 ? '1' : '0');
    return res;
}

int Answer(string str){
    int pos = y % HALF;
    int res = 0;
    FR(i, 14){
        res |= (str[pos*14 + i]-'0') << i;
    }
    return res;
}

Compilation message (stderr)

grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...