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

AcWing 862. 三元组排序 更多...

#include <acwing.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

AcWing 862. 三元组排序

在文件 acwing.h1735 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp5271 行定义.

5271 {
5272 int n;
5273 cin >> n;
5274 auto comp = [](tuple<int, float, string> a, tuple<int, float, string> b) {
5275 auto [ax, ay, az] = std::move(a);
5276 auto [bx, by, bz] = std::move(b);
5277 return ax < bx;
5278 };
5279 set<tuple<int, float, string>, decltype(comp)> s(comp);
5280 for(int i = 0; i < n; i++) {
5281 int x;
5282 float y;
5283 string z;
5284 cin >> x >> y >> z;
5285 s.insert(make_tuple(x, y, z));
5286 }
5287 for(const auto &t: s) {
5288 auto [x, y, z] = t;
5289 cout << x << ' ' << fixed << setprecision(2) << y << ' ' << z << endl;
5290 }
5291 return 0;
5292 }

被这些函数引用 acwing::TEST().


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