摘要: 题目:http://codeforces.com/contest/237/problem/A那么简单的题目,还是忘了考虑n = 1时的情况了。。。View Code 1 typedef long long ll; 2 const int N = 100001; 3 char str[N][10]; 4 int main() 5 { 6 int n; 7 int i; 8 while(~scanf("%d",&n)) 9 {10 getchar();11 for(i = 0; i < n; i++)12 {13 ... 阅读全文
posted @ 2012-10-26 22:11 AC_Girl 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.timus.ru/problem.aspx?space=1&num=1286题目要求 p * x1 + q * y1 = abs(ex - sx) && p * x2 + q * y2 = abs(ey - sy)同时成立,设 d = gcd(p,q) ,dx = abs(ex - sx), dy = (ey - sy),如果 (dx % d || dy % d )成立,那么从开始点一定到不了终点,否则 dx /= d, dy /= d, p /= d, q /= d;分情况讨论,详见此出http://shaidaima.com/source 阅读全文
posted @ 2012-10-26 20:27 AC_Girl 阅读(157) 评论(0) 推荐(0) 编辑