名字的漂亮度=26*字母个数最多的+25*字母个数其次的+24*字母个数再其次的(忽略大小写)+….+1*出现次数最小的。
输入:整数N,N个字符串
输出:N个字符串漂亮度例如:
输入1 a
输出 26c#include
#include
#include
#include
using namespace std;b...
分类:
其他好文 时间:
2015-06-27 18:28:54
阅读次数:
152
题意:求数组中两个不同元素使得两元素和%p最大。
分析:
1、序列中的数可能超过P,将所有数读入后进行模P操作。
2、将取模后的所有数从小到大排序,现在所有数都是小于P且排好序的。
3、假设任意选了两个数X和Y,则0≤X+Y≤2P-2。若X+Y
#include
#include
using namespace std;
__int64 a[100005];
int main()
{...
分类:
其他好文 时间:
2015-06-27 18:26:46
阅读次数:
173
#include
#include
#include
using namespace std;
void Print(int &item)
{
cout<<item<<" ";
}
int main()
{
list listintegers;
list::iterator listiter; //引入迭代器...
分类:
其他好文 时间:
2015-06-27 18:21:52
阅读次数:
128
1 该栈只用于存在int型数据 1 #include "../require.h" 2 #include 3 4 using namespace std; 5 6 7 class IntStack 8 { 9 enum { ssize = 20 }; 10 ...
分类:
其他好文 时间:
2015-06-27 18:13:16
阅读次数:
86
一副牌中发五张扑克牌给你:让你判断数字的组成:
有以下几种情况:
1:四条:即四张一样数值的牌(牌均不论花色)
2:三条带 一对
3:三条带两张不相同数值的牌
4:两对
5:顺子 包括 10,J,Q,K,A
6:什么都不是
7:只有一对。c#include
#include
#include
using name...
分类:
其他好文 时间:
2015-06-27 16:46:30
阅读次数:
134
在一个行列依此增大的二维数组中,最快判断数组中有无此数。
#include
using namespace std;
#define ROW 4
#define COLUMN 3
typedef int Shuzu[ROW][COLUMN];
#define ElementType int
bool Find(int *matrix,int rows,int column...
分类:
编程语言 时间:
2015-06-27 16:46:06
阅读次数:
147
【题目链接】:click here~~
【题目大意】
一组题目的数目(n
【解题思路】:
DFS+回溯。
先发一发比较拙的代码:
#include
using namespace std;
const int N=1e5+10;
int num[N],mum[N];
int n,m,q,t,l,r;
int top,ans,cnt;
void dfs(int...
分类:
其他好文 时间:
2015-06-27 16:44:44
阅读次数:
115
水题
#include
using namespace std;
int main()
{
int x,y,z,n;
scanf("%d%d%d%d",&x,&y,&z,&n);
for(int i=0;i<n;++i)
printf("0 0 %.8lf %d %d %.8lf\n",(z*1.0/n)*i,x,y,(z*1.0/n)*(i+1));
return 0;
}...
分类:
其他好文 时间:
2015-06-27 16:33:39
阅读次数:
202
#include
using namespace std;
int a[10]= {1,2, 3, 4, 5, 6, 7, 8, 9, 10};
int fun( int i);
int main()
{
int i ,s=0;
for( i=0; i<=10; i++)
{
try
{
s=s+fun(i);
...
分类:
其他好文 时间:
2015-06-27 16:28:28
阅读次数:
118
#include
using namespace std;
namespace CounterNameSpace
{
int upperbound;
int lowerbound;
class counter
{
int count;
public:
counter(int n)
{
if (n <= upperbound )
{
...
分类:
其他好文 时间:
2015-06-27 16:28:02
阅读次数:
117