30 unsigned long long seed;
32 return {self_player_id, seed};
43 int count, type, arg0, arg1 = -1;
46 for (
int i = 0; i < count; i++)
75 int coin0, coin1, hp0, hp1;
88 int id, player, x, y, type, cd, hp, level, age, state;
93 for (
int i = 0; i < tower_num; ++i)
95 std::cin >>
id >> player >> x >> y >> type >> cd;
102 for (
int i = 0; i < ant_num; ++i)
104 std::cin >>
id >> player >> x >> y >> hp >> level >> age >> state;
108 std::cin >> info.coin0 >> info.coin1;
188 static_cast<char*
>(dest)[size - i - 1] =
static_cast<const char*
>(src)[i];
202 for (
int i = 0; i < 4; ++i)
225 int total_len =
static_cast<int>(op_num_len + op_len);
TowerType
Tag for the type of a tower. The integer values of these enumeration items are also their indexes.
Definition: common.hpp:319
OperationType
Tag for the type of an operation. The integer values of these enumeration items are also their indexe...
Definition: common.hpp:723
@ UpgradeGenerationSpeed
Increase ant producing speed.
Definition: common.hpp:734
@ UpgradeGeneratedAnt
Increase HP of newly generated ants.
Definition: common.hpp:735
@ DowngradeTower
Downgrade/Destroy a tower.
Definition: common.hpp:727
AntState
State of an ant, indicating its life cycle stages.
Definition: common.hpp:218
T emplace_back(T... args)
std::vector< Operation > read_opponent_operations()
Read your opponent's operations and deserialize them. The time to call this function depends on your ...
Definition: io.hpp:40
void convert_to_big_endian(const void *src, std::size_t size, void *dest)
Convert an object into big-endian representation.
Definition: io.hpp:185
std::size_t object_length(int x)
Calculate the length of the serialized result of a non-negative integer, without actually serializing...
Definition: io.hpp:124
void send_operations(const std::vector< Operation > &ops)
Send some serialized operations with header to judger.
Definition: io.hpp:220
InitInfo read_init_info()
Read information for initialization.
Definition: io.hpp:27
void print_header(int size)
Print the header, i.e. the total size in big-endian binary representation.
Definition: io.hpp:197
void send_string(const std::string &str)
Send raw string with header to judger.
Definition: io.hpp:210
RoundInfo read_round_info()
Read information at the beginning of a round and deserialize.
Definition: io.hpp:82
Player's operations. It is able to be applied to the map.
Definition: common.hpp:742
static constexpr int INVALID_ARG
Placeholder for the second argument.
Definition: common.hpp:745
A combination of deserialized information about current round state received from judger.
Definition: io.hpp:71