Problem 2620 --Permutation - Sorting Tuples

2620: Permutation - Sorting Tuples

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $10$ 正确数量 $10$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL

Sorting Tuples Write a program which reads n items and sorts them. 

Each item has attributes {value,weight,type,date,name} and they are represented by { integer, integer, upper-case letter, integer, string } respectively. 

Sort the items based on the following priorities. 

first by value (ascending) 

in case of a tie, by weight (ascending)

 in case of a tie, by type (ascending in lexicographic order)

 in case of a tie, by date (ascending) 

in case of a tie, by name (ascending in lexicographic order)

The input is given in the following format. 

v0 w0 t0 d0 s0

v1 w1 t1 d1 s1 

vn−1 wn−1 tn−1 dn−1 sn−1 

In the first line, the number of items n.

 In the following n lines, attributes of each item are given.

 viwitidisi represent value, weight, type, date and name of the i-th item respectively.

Print attributes of each item in order. 

Print an item in a line and adjacency attributes should be separated by a single space.

5
105 24 C 1500000000000 white
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
110 25 B 1500000000000 black
110 20 A 1300000000000 gree
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
105 24 C 1500000000000 white
110 20 A 1300000000000 gree
110 25 B 1500000000000 black

1≤n≤100,000 

0≤vi≤1,000,000,000 

0≤wi≤1,000,000,000

 ti is a upper-case 

letter 0≤di≤2,000,000,000,000 

1≤ size of si≤20 si≠sj if (i≠j)

推荐代码 查看2620 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] Qiqy 608953 2020-07-30 15:42:08
内存最少[$2028 $KB] 刘 涛 343255 2018-12-11 19:50:28
第一AC AOJ大管家 281942 2018-10-07 16:35:53
第一挑战 AOJ大管家 281942 2018-10-07 16:35:53

赛题来源/所属竞赛 会津大学《C++ Programming II》 C++程序设计(高级)

竞赛编号 竞赛名称 竞赛时间 访问比赛