Children's Game UVA
来源:互联网 发布:淘宝店铺怎么改折扣 编辑:程序博客网 时间:2024/06/03 18:20
贪心,主要是排序的方法,自己想了好久,没想出来,看了题解,恍然大悟,原来还能这样写,又新学到了一个技能点O(∩_∩)O哈哈~
#include<iostream>#include<algorithm>#include<string>#include<vector>#include<cstdio>using namespace std;string strs[55];bool cmp(string a, string b) { return a + b > b + a;}int main() { int n; while(scanf("%d",&n) == 1 && n) { for(int i = 0; i < n; ++i) { cin >> strs[i]; } sort(strs, strs + n, cmp); for(int i = 0; i < n; ++i) { cout << strs[i]; } cout << endl; } return 0;}
阅读全文
0 0
- uva Children's Game
- Uva Children's Game
- Children's Game UVA
- Children's Game UVA
- Children's Game UVA
- Children's Game UVA
- UVa 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905 - Children's Game
- uva 10905 - Children's Game
- UVA 10905 Children's Game
- UVa 10905 - Children's Game
- Uva-10905-Children’s Game
- UVa 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905-Children’s Game
- Manthan, Codefest 17-C-Helga Hufflepuff's Cup(树形DP)
- AJAX学习笔记(三)_XMLHttpRequest向服务器发送请求
- React 组件基本使用(三) ---父子组件之间的通信
- 【Web】Javascript多项式计算器
- Cannot resolve symbol 'permission'
- Children's Game UVA
- Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
- Java 任务调度框架 Quartz《一》
- sed 命令 解析及使用
- 深入解析array_merge函数的用法 php
- getopt函数,命令选项解析函数的分析
- 什么是分布式系统
- Servlet
- BZOJ 4569: [Scoi2016]萌萌哒 并查集+倍增