杂谈ooxx

首先让我们看看一类acm上频频出现的水题,不知为多少人贡献了一个又一个的AC:

今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二,问物几何?

看到这句话,大家就知道这篇日志是闲聊初等数论中解同余式的问题了吧。

其实,刚刚在网上看到一个与韩信点兵没有任何关系的微博,结果就让我想起来了老韩的这个著名故事。

这篇微博是这样的:

阅读更多

python socket通讯

话说今天公司某同事工作之余用delphi写了一个小型的聊天工具,ym一下:

每次看到pascal的语法,就想起来自己的一件囧事。话说某年预赛运气好进了校ACM决赛,我整个人神清气爽的来到机房,本想好好发挥一下;结果开赛后做水题时,发现题目果然很水,就直接在提交框里写的程序,但我竟然脑抽筋的在c++中用了”:=”进行赋值操作,于是submit后自然而然的拿到了第一个CE。还好自己不是以IT为生,学了这么多语言的基本用法也仅仅是应对各个项目的一些需要,就不在乎博而不精的敝处了。

好了,闲话不谈,今天的主题是在python中使用socket通讯。

阅读更多

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
看来题意理解错的不在少数。

poj2363