Language: C++

#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int32 i = (a); i < (b); ++i)
#define rrep(i,a,b) for(int32 i = (b) - 1; i >= (a); --i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define ALL(x) (x).begin(),(x).end()
#define C(x) cout << #x << " : " << x << endl
#define scanf scanf_s

using int32 = int_fast32_t;
using int64 = int_fast64_t;
using uint32 = uint_fast32_t;
using uint64 = uint_fast64_t;

using namespace std;
uint32 __builtin_ctzll(uint64 c) {
	uint32 t = 63;
	if (c & 0x00000000FFFFFFFF) { c = c & 0x00000000FFFFFFFF;t -= 32; }
	if (c & 0x0000FFFF0000FFFF) { c = c & 0x0000FFFF0000FFFF;t -= 16; }
	if (c & 0x00FF00FF00FF00FF) { c = c & 0x00FF00FF00FF00FF;t -= 8; }
	if (c & 0x0F0F0F0F0F0F0F0F) { c = c & 0x0F0F0F0F0F0F0F0F;t -= 4; }
	if (c & 0x3333333333333333) { c = c & 0x3333333333333333;t -= 2; }
	if (c & 0x5555555555555555) { c = c & 0x5555555555555555;t -= 1; }
	return t;
}
uint32 __builtin_clzll(uint64 c) {
	uint32 t = 63;
	if (c & 0xFFFFFFFF00000000) { c = c & 0xFFFFFFFF00000000;t -= 32; }
	if (c & 0xFFFF0000FFFF0000) { c = c & 0xFFFF0000FFFF0000;t -= 16; }
	if (c & 0xFF00FF00FF00FF00) { c = c & 0xFF00FF00FF00FF00;t -= 8; }
	if (c & 0xF0F0F0F0F0F0F0F0) { c = c & 0xF0F0F0F0F0F0F0F0;t -= 4; }
	if (c & 0xCCCCCCCCCCCCCCCC) { c = c & 0xCCCCCCCCCCCCCCCC;t -= 2; }
	if (c & 0xAAAAAAAAAAAAAAAA) { c = c & 0xAAAAAAAAAAAAAAAA;t -= 1; }
	return t;
}
const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
const uint64 bitmaskl[64] = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183, 34359738367, 68719476735, 137438953471, 274877906943, 549755813887, 1099511627775, 2199023255551, 4398046511103, 8796093022207, 17592186044415, 35184372088831, 70368744177663, 140737488355327, 281474976710655, 562949953421311, 1125899906842623, 2251799813685247, 4503599627370495, 9007199254740991, 18014398509481983, 36028797018963967, 72057594037927935, 144115188075855871, 288230376151711743, 576460752303423487, 1152921504606846975, 2305843009213693951, 4611686018427387903, 9223372036854775807 };
struct VEBtip {
	std::vector<uint64> tree;
	uint64 aux = 0;
	uint32 t;
	uint64 u;
	VEBtip() :tree(64) {}
	void _insert(const uint32 &p) {
		if (!tree[p >> 6]) {
			aux |= 1LL << (p >> 6);
		}
		tree[p >> 6] |= 1LL << (p & 63);
		return;
	}
	void _delete(const uint32 &p) {
		tree[p >> 6] ^= 1LL << (p & 63);
		if (!tree[p >> 6]) {
			aux ^= 1LL << (p >> 6);
		}
		return;
	}
	bool _find(const uint32 &p) {
		return tree[p >> 6] >> (p & 63) & 1;
	}
	uint32 _min() {
		return (__builtin_ctzll(aux) << 6) | __builtin_ctzll(tree[__builtin_ctzll(aux)]);
	}

	uint32 _findnext(const uint32 &p) {
		if (tree[p >> 6] & bitmaskr[p & 63]) {
			return (p & 4032) | __builtin_ctzll(tree[p >> 6] & bitmaskr[p & 63]);
		}
		else {
			if (aux&bitmaskr[p >> 6]) {
				return (__builtin_ctzll(aux&bitmaskr[p >> 6]) << 6) | __builtin_ctzll(tree[__builtin_ctzll(aux&bitmaskr[p >> 6])]);
			}
			else {
				return 4294967295;
			}
		}
	}
	uint32 _findprev(const uint32 &p) {
		if (tree[p >> 6] & bitmaskl[p & 63]) {
			return (p & 4032) | (63 - __builtin_clzll(tree[p >> 6] & bitmaskl[p & 63]));
		}
		else {
			if (aux&bitmaskl[p >> 6]) {
				return ((63 - (__builtin_clzll(aux&bitmaskl[p >> 6]))) << 6) | (63 - __builtin_clzll(tree[63 - __builtin_clzll(aux&bitmaskl[p >> 6])]));
			}
			else {
				return 4294967295;
			}
		}
	}
};

class VEBTree {
	uint32 root[2] = { 4294967295,4294967295 };
	vector<uint32> tree;
	vector<VEBtip> bits;
	uint32 temp, now;
public:
	VEBTree() :tree(8194, 4294967295), bits(4097) {
		for (temp = 8193;~temp;temp -= 2) {
			tree[temp] = 0;
		}
	}
	//???????????????
	bool Empty() {
		return !~root[0];
	}
	//????°????
	uint32 Min() {
		return root[0];
	}
	//?????§???
	uint32 Max() {
		return root[1];
	}
	//key????????\
	void Insert(uint32 key) {
		if (~root[0]) {
			if (root[0] > key) {
				temp = key;
				key = root[0];
				root[0] = temp;
			}
			else if (root[1] < key) {
				root[1] = key;
			}
			now = (key >> 11) & 8190;
			if (~tree[now]) {
				if (tree[now] > key) {
					temp = key;
					key = tree[now];
					tree[now] = temp;
				}
				else if (tree[now | 1] < key) {
					tree[now | 1] = key;
				}
				bits[now >> 1]._insert(key & 4095);
			}
			else {
				tree[now] = key;
				tree[now | 1] = key;
				key = now >> 1;
				if (~tree[8192]) {
					if (tree[8192] > key) {
						temp = key;
						key = tree[8192];
						tree[8192] = temp;
					}
					else if (tree[8193] < key) {
						tree[8193] = key;
					}
					bits[4096]._insert(key);
				}
				else {
					tree[8192] = key;
					tree[8193] = key;
				}
			}
		}
		else {
			root[0] = key;
			root[1] = key;
		}
		return;
	}
	//key?????????
	void Delete(uint32 key) {
		if (root[0] == key) {
			if (root[1] == key) {
				root[0] = 4294967295;
				root[1] = 0;
			}
			else {
				now = tree[8192] << 1;
				key = tree[now];
				root[0] = key;
				if (tree[now | 1] == key) {
					tree[now] = 4294967295;
					tree[now | 1] = 0;
					key = bits[4096]._min();
					tree[8192] = key;
					bits[4096]._delete(key);
				}
				else {
					key = bits[now >> 1]._min();
					tree[now] = now << 11 | key;
					bits[now >> 1]._delete(key);
				}
			}
		}
		else{
			if (root[1] == key) {

			}
			else {

			}
		}
		return;
	}
	//key????????¨?????????
	bool Find(const uint32 &key) {
		return bits[key >> 12]._find(key & 4095) || tree[key >> 11 & 8190] == key || root[0] == key;
	}
	//key????????§??????????°????????´?
	uint32 Findnext(const uint32 &key) {
		if (root[0] > key) {
			return root[0];
		}
		else if (root[1] <= key) {
			return 4294967295;
		}
		else {
			now = key >> 11 & 8190;
			if (tree[now | 1] <= key) {
				return tree[(bits[4096]._findnext(now >> 1)) << 1];
			} else {
				if (tree[now] <= key) {
					return (key & 16773120) | (bits[now >> 1]._findnext(key & 4095));
				}
				else {
					return tree[now];
				}
			}
		}
	}
	//key???????°????????????§???????´?
	uint32 Findprev(const uint32 &key) {

	}
};

struct Ar {
	vector<uint32> t;
	void Insert(uint32 a) {
		t.push_back(a);
	}
	void Delete(uint32 a) {
		rep(i, 0, t.size()) {
			if (t[i] == a)
				t[i] = -1;
		}
	}
	bool Find(uint32 a) {
		rep(i, 0, t.size()) {
			if (t[i] == a)
				return true;
		}
		return false;
	}
	uint32 Findnext(uint32 a) {
		sort(ALL(t));
		rep(i, 0, t.size()) {
			if (t[i] > a)
				return t[i];
		}
		return 4294967295;
	}
};

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	VEBTree t;
	uint32 n;
	cin >> n;
	vector<int32> a(n);
	rep(i, 0, n)
		cin >> a[i];
	int64 sum = 0;
	rep(i, 0, n) {
		sum += a[i];
		t.Insert(a[i] + 1e6);
	}
	cout << t.Min() - 1e6 << " " << t.Max() - 1e6 << " " << sum << endl;
	return 0;
}

Compiler output:
a.cc:52:31: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                               ^~~~~~~~~~~~~~~~~~~~
a.cc:52:53: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                                                     ^~~~~~~~~~~~~~~~~~~~
a.cc:52:75: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                                                                           ^~~~~~~~~~~~~~~~~~~~
a.cc:52:97: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                                                                                                 ^~~~~~~~~~~~~~~~~~~~
a.cc:52:119: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                                                                                                                       ^~~~~~~~~~~~~~~~~~~~
a.cc:52:141: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0 };
      |                                                                                                                                             ^~~~~~~~~~~~~~~~~~~~
a.cc:52:163: warning: integer constant is so large that it is unsigned
   52 | const uint64 bitmaskr[64] = { 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 184467440737074544