落絮飞雁

顺流而下,把梦做完

随机名言141214更新

再来更新一下博客首页的随机名言。 READ MORE →

源路径太长:源文件名长度大于文件系统支持的长度 解决方法

中文错误提示:

源路径太长:源文件名长度大于文件系统支持的长度。请尝试将其移动到具有较短路径名称的位置,或者在执行此操作前尝试将其重命名为较短的名称。

删除文件夹:是否要永久删除此文件夹?该文件夹包含名称过长且无法放入回收站的项目。

Windows shows the error:

Destination Path Too Long:  The file name(s) would be too long for the destination folder.  You can shorten the file name and try again, or try a location that has a shorter path.

Source Path Too Long:  The source file name(s) are larger than is supported by the file system.  Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation.

 


 

软件LongPathTool可以删除上述文件名

HDOJ2054:A==B? 字符串处理、看似水题

Problem Description
Give you two numbers A and B, if A is equal to B, you should print “YES”, or print “NO”.

 

Input
each test case contains two numbers A and B.

 

Output
for each case, if A is equal to B, you should print “YES”, or print “NO”.

 

Sample Input
1 2
2 2
3 3
4 3

 

Sample Output
NO
YES
YES
NO
主要考虑:数字中负号的处理、前导和后导零的问题;尽量开大数组。

 

#include
#include
using namespace std;
char a[100000], b[100000];
bool is(char *p)
{
	for (; *p != ' '; p++)
	if (*p == '.')return true;
	return false;
}

void det(char *p)
{
	for (; *p != ' '; p++);
	p--;
	for (; *p == '0'; p--)
		*p = ' ';
	if (*p == '.')*p = ' ';
}

int main()
{
	while (cin >> a >> b)
	{
		if (is(a))det(a);
		if (is(b))det(b);
		if (strcmp(a, b) == 0)cout 
	

C++ 虚调用实例

原文自http://see.xidian.edu.cn/cpp/biancheng/view/244.html


#include 
#include 
using namespace std;
//声明基类Student
class Student
{
public:
   Student(int, string,float);  //声明构造函数
   void display( );//声明输出函数
protected:  //受保护成员,派生类可以访问
   int num;
   string name;
   float score;
};
//Student类成员函数的实现
Student::Student(int n, string nam,float s)//定义构造函数
{
   num=n;
   name=nam;
   score=s;
}
void Student::display( )//定义输出函数
{
   coutdisplay( );
   pt=&grad1;
   pt->display( );
   return 0;
}

HDOJ5003:Osu!——套公式的水题

Problem Description
Osu! is a famous music game that attracts a lot of people. In osu!, there is a performance scoring system, which evaluates your performance. Each song you have played will have a score. And the system will sort all you scores in descending order. After that, the i-th song scored ai will add 0.95^(i-1)*ai to your total score.

Now you are given the task to write a calculator for this system.

Input

The first line contains an integer T, denoting the number of the test cases.

For each test case, the first line contains an integer n, denoting the number of songs you have played. The second line contains n integers a1, a2, …, an separated by a single space, denoting the score of each song.

T<=20, n<=50, 1<=ai<=500.

Output

For each test case, output one line for the answer.

Your answers will be considered correct if its absolute error is smaller than 1e-5.

Sample Input

1
2
530 478

Sample Output

984.1000000000
水题,套题目描述里面的公式即可。
#include
#include
#include 
#include
#include
using namespace std;
double ai[100];
int main(){
	int n, i, j, cas;
	double res;
	scanf("%d",&cas);
	while (cas--){
		scanf("%d", &n);
		res = 0;
		for (i = 0; i= 0; i--){
			res += pow(0.95, n - 1 - i)*ai[i];
		}
		printf("%.10lfn", res);
	}
	return 0;
}

POJ1852:Ants

Description
An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they turn back and start walking in opposite directions. We know the original positions of ants on the pole, unfortunately, we do not know the directions in which the ants are walking. Your task is to compute the earliest and the latest possible times needed for all ants to fall off the pole.

Input

The first line of input contains one integer giving the number of cases that follow. The data for each case start with two integer numbers: the length of the pole (in cm) and n, the number of ants residing on the pole. These two numbers are followed by n integers giving the position of each ant on the pole as the distance measured from the left end of the pole, in no particular order. All input integers are not bigger than 1000000 and they are separated by whitespace.

Output

For each case of input, output two numbers separated by a single space. The first number is the earliest possible time when all ants fall off the pole (if the directions of their walks are chosen appropriately) and the second number is the latest possible such time.

Sample Input

2
10 3
2 6 7
214 7
11 12 7 13 176 23 191

Sample Output

4 8
38 207

可以认为所有的蚂蚁都朝着竿的两端前进,并且两只蚂蚁相遇时可以无视。(即,两只蚂蚁穿过对方,而没有反方向爬回去)。所以求最长最短时间,只需求蚂蚁到竿子一端的最大最小距离即可。
代码:

#include
#include
#include
#include
using namespace std;
int main()
{
	int j;
	scanf("%d", &j);
	while (j--)
	{
		int L, n,ni;
		int x[1000000];
		memset(0, L, sizeof L);
		memset(0, n, sizeof n);
		scanf("%d,%d", &L, &n);
		for (ni = 0; ni 
	

DD-WRT做二级路由的设置方法

主路由不用动,开DHCP即可。

二级路由先连电脑,后台设置:

禁用WAN口,设置IP与主路由同一网段且无冲突。网关留空。关闭DHCP服务器。

如图:

网线连接主路由LAN口和二级路由WAN口。

修改Chrome默认搜索引擎为Google.com

因为谷歌会把你的默认搜索引擎改为本地域名(如google.com.hk)。但从稳定性和功能性考虑的话,还是希望Chrome的默认引擎是google.com。

具体修改方法:

  1. 关闭Chrome
  2. 打开C:Users你的用户名AppDataLocalGoogleChromeUser DataDefault(Win8下,其他类似)找到Preferences文件并打开
  3. 找到last_known_google_url 和 last_prompted_google_url这两行,修改为Google.com即可。

打开Chrome,完毕~

FreeNAS简明U盘安装

时隔半年之后,又开始折腾FreeNAS了。才发现之前写的教程还没完工。趁此补上~


这个方法是将Img文件写到U盘上,通过U盘启动。将硬盘全部做存储用。

  1. 在FreeNAS官网上下载U盘版的img文件。(建议用2GB以上容量的U盘)
  2. 下载后得到一个.xz文件。可用7z解压后得到img映像文件。
  3. 用imageWriter一类工具将img文件写入U盘。即可得到FreeNAS启动U盘。

    以上。之后,在Bios中选择从U盘启动,等待约两分钟之后,即可看到屏幕上显示出FreeNAS的IP地址。其他设备即可访问FreeNAS的webUI~

 

解决Youtube不能评论问题

在youtube发评论时,出现一个弹窗,点一下就消失了。不能发表评论。出现这种问题一般是Chrome浏览器设置不允许使用第三方Cookie。

遇到这种情况,可能是浏览器设置不允许使用第三方Cookie,可以通过以下步骤解决。

解决方法:(以Chrome为例)设置——内容设置——cookie中设置例外:允许apis.google.com即可。

具体步骤:在菜单中选择设置,进入站点设置

选择站点设置

选择Cookies设置,然后添加一条例外规则。

填入以下地址:

apis.google.com

保存后重启浏览器生效。

欢迎留言反馈。