洛谷 P1205 [USACO1.2] 方块转换 Transformations
更多...
#include <luogu.h>
|
static bool | equal (int n, char **start, char **end) |
|
static int | main (istream &cin, ostream &cout) |
|
static char ** | reflect (int n, char **start) |
|
static char ** | rorate180 (int n, char **start) |
|
static char ** | rorate270 (int n, char **start) |
|
static char ** | rorate90 (int n, char **start) |
|
洛谷 P1205 [USACO1.2] 方块转换 Transformations
在文件 luogu.h 第 486 行定义.
◆ equal()
bool luogu::P1205::equal |
( |
int |
n, |
|
|
char ** |
start, |
|
|
char ** |
end |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1801 行定义.
1802 for(
int i = 0; i < n; i++) {
1803 for(
int j = 0; j < n; j++) {
1804 if(start[i][j] != end[i][j]) {
被这些函数引用 main().
◆ main()
int luogu::P1205::main |
( |
istream & |
cin, |
|
|
ostream & |
cout |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1681 行定义.
1685 auto *start =
new char *[n];
1686 auto *end =
new char *[n];
1687 for(
int i = 0; i < n; i++) {
1688 start[i] =
new char[n];
1689 for(
int j = 0; j < n; j++) {
1693 for(
int i = 0; i < n; i++) {
1694 end[i] =
new char[n];
1695 for(
int j = 0; j < n; j++) {
1699 auto *
const r90 =
rorate90(n, start);
1702 auto *
const r =
reflect(n, start);
1703 auto *
const rr90 =
reflect(n, r90);
1704 auto *
const rr180 =
reflect(n, r180);
1705 auto *
const rr270 =
reflect(n, r270);
1706 if(
equal(n, r90, end)) {
1708 }
else if(
equal(n, r180, end)) {
1710 }
else if(
equal(n, r270, end)) {
1712 }
else if(
equal(n, r, end)) {
1714 }
else if(
equal(n, rr90, end)) {
1716 }
else if(
equal(n, rr180, end)) {
1718 }
else if(
equal(n, rr270, end)) {
1720 }
else if(
equal(n, start, end)) {
1726 for(
int i = 0; i < n; i++) {
static char ** rorate90(int n, char **start)
static bool equal(int n, char **start, char **end)
static char ** rorate180(int n, char **start)
static char ** reflect(int n, char **start)
static char ** rorate270(int n, char **start)
引用了 equal(), reflect(), rorate180(), rorate270() , 以及 rorate90().
被这些函数引用 luogu::TEST().
◆ reflect()
char ** luogu::P1205::reflect |
( |
int |
n, |
|
|
char ** |
start |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1788 行定义.
1789 auto *
const cpy =
new char *[n];
1790 for(
int i = 0; i < n; i++) {
1791 cpy[i] =
new char[n];
1793 for(
int i1 = 0, i2 = 0; i1 < n && i2 < n; i1++, i2++) {
1794 for(
int j1 = 0, j2 = n - 1; j1 < n && j2 >= 0; j1++, j2--) {
1795 cpy[i1][j1] = start[i2][j2];
被这些函数引用 main().
◆ rorate180()
char ** luogu::P1205::rorate180 |
( |
int |
n, |
|
|
char ** |
start |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1762 行定义.
1763 auto *
const cpy =
new char *[n];
1764 for(
int i = 0; i < n; i++) {
1765 cpy[i] =
new char[n];
1767 for(
int i1 = 0, i2 = n - 1; i1 < n && i2 >= 0; i1++, i2--) {
1768 for(
int j1 = 0, j2 = n - 1; j1 < n && j2 >= 0; j1++, j2--) {
1769 cpy[i1][j1] = start[i2][j2];
被这些函数引用 main().
◆ rorate270()
char ** luogu::P1205::rorate270 |
( |
int |
n, |
|
|
char ** |
start |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1775 行定义.
1776 auto *
const cpy =
new char *[n];
1777 for(
int i = 0; i < n; i++) {
1778 cpy[i] =
new char[n];
1780 for(
int i1 = 0, j2 = n - 1; i1 < n && j2 >= 0; i1++, j2--) {
1781 for(
int j1 = 0, i2 = 0; j1 < n && i2 < n; j1++, i2++) {
1782 cpy[i1][j1] = start[i2][j2];
被这些函数引用 main().
◆ rorate90()
char ** luogu::P1205::rorate90 |
( |
int |
n, |
|
|
char ** |
start |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1749 行定义.
1750 auto *
const cpy =
new char *[n];
1751 for(
int i = 0; i < n; i++) {
1752 cpy[i] =
new char[n];
1754 for(
int i1 = 0, j2 = 0; i1 < n && j2 < n; i1++, j2++) {
1755 for(
int j1 = 0, i2 = n - 1; j1 < n && i2 >= 0; j1++, i2--) {
1756 cpy[i1][j1] = start[i2][j2];
被这些函数引用 main().
该类的文档由以下文件生成: