problemscpp
A collection of my answers to algorithm problems in c++.
Public 成员函数 | Public 属性 | 所有成员列表
acwing::acwing1470::status结构体 参考

#include <acwing.h>

Public 成员函数

 status (int len, pair< int, int > current, pair< int, int > target)
 
int get_weight () const
 
bool operator< (const status &s) const
 

Public 属性

pair< int, int > current
 
int len
 
pair< int, int > target
 

详细描述

在文件 acwing.h1855 行定义.

构造及析构函数说明

◆ status()

acwing::acwing1470::status::status ( int  len,
pair< int, int >  current,
pair< int, int >  target 
)
inline

在文件 acwing.h1862 行定义.

1863 : len(len), current(std::move(current)), target(std::move(target)) {}
pair< int, int > current
Definition: acwing.h:1857
pair< int, int > target
Definition: acwing.h:1858

成员函数说明

◆ get_weight()

int acwing::acwing1470::status::get_weight ( ) const

在文件 acwing.cpp5978 行定义.

5978{ return len + abs(current.first - target.first) + abs(current.second - target.second); }

引用了 current, len , 以及 target.

被这些函数引用 operator<().

◆ operator<()

bool acwing::acwing1470::status::operator< ( const status s) const

在文件 acwing.cpp5976 行定义.

5976{ return this->get_weight() > s.get_weight(); }

引用了 get_weight().

类成员变量说明

◆ current

pair<int, int> acwing::acwing1470::status::current

在文件 acwing.h1857 行定义.

被这些函数引用 get_weight() , 以及 acwing::acwing1470::main().

◆ len

int acwing::acwing1470::status::len

在文件 acwing.h1856 行定义.

被这些函数引用 get_weight() , 以及 acwing::acwing1470::main().

◆ target

pair<int, int> acwing::acwing1470::status::target

在文件 acwing.h1858 行定义.

被这些函数引用 get_weight().


该结构体的文档由以下文件生成: