Submission #62960

# Submission time Handle Problem Language Result Execution time Memory
62960 2018-07-31T04:02:10 Z qkxwsm Airline Route Map (JOI18_airline) C++14
Compilation error
0 ms 0 KB
#include "Alicelib.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

struct chash
{
        int operator()(int x) const
        {
                x ^= (x >> 20) ^ (x >> 12);
                return x ^ (x >> 7) ^ (x >> 4);
        }
        int operator()(long long x) const
        {
                return x ^ (x >> 32);
        }
};

template<typename T> using orderedset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename U> using hashtable = gp_hash_table<T, U, chash>;

template<class T>
void readi(T &x)
{
        T input = 0;
        bool negative = false;
        char c = ' ';
        while (c < '-')
        {
                c = getchar();
        }
        if (c == '-')
        {
                negative = true;
                c = getchar();
        }
        while (c >= '0')
        {
                input = input * 10 + (c - '0');
                c = getchar();
        }
        if (negative)
        {
                input = -input;
        }
        x = input;
}
template<class T>
void printi(T output)
{
        if (output == 0)
        {
                putchar('0');
                return;
        }
        if (output < 0)
        {
                putchar('-');
                output = -output;
        }
        int aout[20];
        int ilen = 0;
        while(output)
        {
                aout[ilen] = ((output % 10));
                output /= 10;
                ilen++;
        }
        for (int i = ilen - 1; i >= 0; i--)
        {
                putchar(aout[i] + '0');
        }
        return;
}
template<class T>
void ckmin(T &a, T b)
{
        a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
        a = max(a, b);
}
template<class T>
T normalize(T x, T mod = 1000000007)
{
        return (((x % mod) + mod) % mod);
}
static long long randomizell(long long mod)
{
        return ((1ll << 45) * rand() + (1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}
static int randomize(int mod)
{
        return ((1ll << 15) * rand() + rand()) % mod;
}

#define y0 ___y0
#define y1 ___y1
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define debug(x) cerr << #x << " = " << x << endl;

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;

static int N;
static vector<pii> edge, edges;

void send()
{
	// for (pii x : edges)
	// {
	// 	cerr << "send " << x.fi << ' ' << x.se << endl;
	// }
	InitG(N + 12, edges.size());
	for (int i = 0; i < edges.size(); i++)
	{
		MakeG(i, edges[i].fi, edges[i].se);
	}
	return;
}
void Alice(int n, int m, int a[], int b[])
{
	N = n;
	for (int i = 0; i < m; i++)
	{
		assert(0 <= a[i] && a[i] < N);
		if (a[i] > b[i])
		{
			swap(a[i], b[i]);
		}
		edge.PB(MP(a[i], b[i]));
	}
	for (int i = 0; i < edge.size(); i++)
	{
		int u = edge[i].fi, v = edge[i].se;
		edges.PB(MP(u, v));
	}
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (i & (1 << j))
			{
				edges.PB(MP(i, N + j));
			}
		}
	}
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < i; j++)
		{
			edges.PB(MP(N + j, N + i));
		}
	}
	for (int i = 0; i < N + 10; i++)
	{
		edges.PB(MP(i, N + 10));
	}
	//N + 10 is friends with everybody but N+11
	//N+11 is friends with all the guys in the loop
	for (int i = N; i < N + 10; i++)
	{
		edges.PB(MP(i, N + 11));
	}
	send();
	return;
}



    

Compilation message

Alice.cpp: In function 'void send()':
Alice.cpp:142:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < edges.size(); i++)
                  ~~^~~~~~~~~~~~~~
Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:160:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < edge.size(); i++)
                  ~~^~~~~~~~~~~~~
Alice.cpp: At global scope:
Alice.cpp:97:12: warning: 'int randomize(int)' defined but not used [-Wunused-function]
 static int randomize(int mod)
            ^~~~~~~~~
Alice.cpp:93:18: warning: 'long long int randomizell(long long int)' defined but not used [-Wunused-function]
 static long long randomizell(long long mod)
                  ^~~~~~~~~~~

/tmp/ccx1iXWG.o: In function `main':
grader_bob.cpp:(.text.startup+0xd0): undefined reference to `Bob(int, int, int*, int*)'
collect2: error: ld returned 1 exit status