Now the commencement speakers will typically also wish you good luck and extend good wishes to you. I will not do that, and I’ll tell you why.
From time to time in the years to come, I hope you will be treated unfairly, so that you will come to know the value of justice.
I hope that you will suffer betrayal because that will teach you the importance of loyalty.
Sorry to say, but I hope you will be lonely from time to time so that you don’t take friends for granted.
I wish you bad luck, again, from time to time so that you will be conscious of the role of chance in life and understand that your success is not completely deserved and that the failure of others is not completely deserved either.
And when you lose, as you will from time to time, I hope every now and then, your opponent will gloat over your failure. It is a way for you to understand the importance of sportsmanship.
I hope you’ll be ignored so you know the importance of listening to others,
and I hope you will have just enough pain to learn compassion.
Whether I wish these things or not, they’re going to happen.And whether you benefit from them or not will depend upon your ability to see the message in your misfortunes.
一题:快速幂用long long;
二题:用数组会爆内存,所以用vector;
用vector的好处:
在子函数内部定义vector是动态保存的,当再次返回此状态时,原来的vector内的数据仍然存在
#include<vector>;
vector<long long>vec;
vec.push_back(x);
tot++;
sort(vec.begin(),vec.end());
y=vec[tot-1];
三题:
1.曼哈顿距离:
红色线为曼哈顿距离,绿色线为欧式距离(直线距离),蓝色与黄色为等价曼哈顿距离