-
Notifications
You must be signed in to change notification settings - Fork 0
/
procon26_module.hpp
101 lines (86 loc) · 1.88 KB
/
procon26_module.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef __DEF_H
#define __DEF_H
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
#define STONE_SIZE 8
#define BOARD_SIZE 32
#define BOARD_LOOP 128 //BOARD_SIZE * (BOARD_SIZE / sizeof(char))
struct Stone
{
unsigned char zuku[STONE_SIZE];
};
struct State : public Stone
{
bool flipped;
int turn; // 90 * turn;
};
struct Board
{
unsigned char block[128];
};
struct Problem
{
Board board;
int num;
Stone *stones;
};
class Answer
{
public:
int X;
int Y;
bool flipped;
int turn; // 90 * turn;
int stoneNumber;
string toString();
};
class Answers
{
public:
int num;
vector<Answer> answers;
Answers(int num);
void place(int stoneNumber, int x, int y, bool flipped, int turn);
void place(int stoneNumber, State *, int x, int y);
void print(ostream &os);
};
class StonePicker
{
private:
static const int MAX = 32;
unsigned int dropStones;
unsigned int dropStonesMax;
int num;
int sum;
int blanks;
std::vector<std::vector<State *> > stones;
std::vector<int> indexes;
std::vector<int> zukus;
void sortStones();
int getSum();
void getStones(std::vector<std::vector<State *> > &stones);
public:
StonePicker(std::vector<std::vector<State *> > stones, std::vector<int> zukus, int blanks);
void getNext(std::vector<std::vector<State *> > &stones);
};
class BoardBoolean
{
public:
char boolean[40*40/sizeof(char)];
BoardBoolean();
BoardBoolean *place(int x, int y);
bool check(int x, int y);
};
class SubmissionManager
{
private:
int cnt;
string fileName;
public:
SubmissionManager(string _fileName);
string submit(Answers *answer);
};
#endif