problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
acwing::acwing4208::acwing4208类 参考

#include <acwing.h>

静态 Public 成员函数

static int main (istream &, ostream &)
 

详细描述

在文件 acwing.h308 行定义.

成员函数说明

◆ main()

int acwing::acwing4208::acwing4208::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp690 行定义.

690 {
691 int n;
692 cin >> n;
693 auto records = map<string, trie_node *>();
694 for(int i = 0; i < n; i++) {
695 string name;
696 cin >> name;
697 if(!records.contains(name)) {
698 //不存在记录
699 records[name] = new trie_node(-1, nullptr);
700 }
701 int n2;
702 cin >> n2;
703 for(int j = 0; j < n2; j++) {
704 string phone_number;
705 cin >> phone_number;
706 string phone_number_trim_left;
707 for(int k = 0; k < phone_number.length(); k++) {
708 if(phone_number[k] != '0') {
709 phone_number_trim_left = phone_number.substr(k);
710 break;
711 }
712 }
713 reverse(phone_number_trim_left.begin(), phone_number_trim_left.end());
714 records[name]->insert(phone_number_trim_left);
715 }
716 }
717 cout << records.size();
718 for(auto it: records) {
719 cout << it.first << " ";
720 cout << it.second->count() << " ";
721 it.second->display();
722 }
723 return 0;
724 }
void reverse(struct ListNode *head)

引用了 acwing::acwing3757::reverse().


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