采用脚本设置本机DNS

今日和同事偶然提到了电脑网页不能访问的问题。因为QQ聊天正常,可以初步判定是DNS出了问题。
下面整理下使用bat脚本快速将google的dns加入windows系统的方法。

既然使用到了自动的脚本,那么为防止出错,进行一步备份就是必要的了。

强烈建议使用netsh执行备份作业。恢复起来也方便:

阅读更多

poj2140

奇因素的个数


阅读更多

poj4011

好久没有做了,上午瞟到一特水题,手痒做了下,结果贡献了一WA。我哭,题目不是说从文件读写么……

ACM ICPC 2011–2012, NEERC, Northern Subregional Contest
St Petersburg, October 29, 2011
Problem A. Automated Telephone Exchange

Input file: ate.in
Output file: ate.out
Time limit: 3 seconds
Memory limit: 256 megabytes
In St Petersburg phone numbers are formatted as “XXX–XX–XX”, where the first three digits represent index of the Automated Telephone Exchange (ATE). Each ATE has exactly 10 000 unique phone numbers.
Peter has just bought a new flat and now he wants to install a telephone line. He thinks that a phone number is lucky if the arithmetic expression represented by that phone number is equal to zero. For example, the phone number 102–40–62 is lucky (102 – 40 – 62 = 0), and the number 157–10–47 is not lucky (157 – 10 – 47 = 100 ≠ 0).
Peter knows the index of the ATE that serves his house. To get an idea of his chances to get a lucky number he wants to know how many lucky numbers his ATE has.
Input
The input file contains a single integer number n — the index of Peter’s ATE (100 ≦ n ≦ 999).
Output
Output a single integer number — the number of lucky phone numbers Peter’s ATE has.
Examples

ate.in ate.out
196 3
239 0

Total Submissions: 258 Accepted: 126
看来题意理解错的不在少数。