problemscpp
A collection of my answers to algorithm problems in c++.
载入中...
搜索中...
未找到
comp526::set::cardset类 参考

#include <comp526.h>

Public 成员函数

 cardset ()=default
 
 cardset (card *c)
 
void insert (card *c)
 

Public 属性

unordered_set< card * > cards {}
 
int cnt = 0
 
unsigned short mask = -1
 

详细描述

在文件 comp526.h64 行定义.

构造及析构函数说明

◆ cardset() [1/2]

comp526::set::cardset::cardset ( )
default

◆ cardset() [2/2]

comp526::set::cardset::cardset ( card * c)

在文件 comp526.cpp127 行定义.

127 {
128 this->cards.insert(c);
129 this->cnt = 1;
130 }
unordered_set< card * > cards

引用了 cards , 以及 cnt.

成员函数说明

◆ insert()

void comp526::set::cardset::insert ( card * c)

在文件 comp526.cpp146 行定义.

146 {
147 if(this->mask == (unsigned short) (-1)) {
148 this->mask = calc_mask(c, *this->cards.begin());
149 }
150 this->cards.insert(c);
151 this->cnt++;
152 if(this->cnt == 3) {
153 vector<int> vec = {};
154 for(auto &c: this->cards) {
155 vec.emplace_back(c->id);
156 }
157 std::sort(vec.begin(), vec.end());
158 ans.emplace_back(vec);
159 }
160 }
unsigned short calc_mask(card *c1, card *c2)
vector< vector< int > > ans
int vec[100010]
unsigned short mask

引用了 comp526::set::ans, comp526::set::calc_mask(), cards, cnt, comp526::set::card::id , 以及 mask.

被这些函数引用 comp526::set::main().

类成员变量说明

◆ cards

unordered_set<card *> comp526::set::cardset::cards {}

在文件 comp526.h68 行定义.

68{};

被这些函数引用 cardset(), comp526::set::fit() , 以及 insert().

◆ cnt

int comp526::set::cardset::cnt = 0

在文件 comp526.h67 行定义.

被这些函数引用 cardset() , 以及 insert().

◆ mask

unsigned short comp526::set::cardset::mask = -1

在文件 comp526.h66 行定义.

被这些函数引用 comp526::set::fit() , 以及 insert().


该类的文档由以下文件生成: