题目链接 给出点A(x1,y1),B(x2,y2),和n条直线(ai,bi,ci,aix + biy + ci = 0),求A到B穿过多少条直线 枚举每条直线判断A.B是否在该直线两侧即可 #include<bits/stdc++.h> using namespace std; #define y1 asodifu double x1,y1,x2,y2; double a,b,c; ; bool check() { if((a*x1+b*y1+c)*(a*x2+b*y2+c)<eps)…
A. Crazy Town 题目连接: http://codeforces.com/contest/498/problem/A Description Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The r…
C. Crazy Town time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where …
C. Crazy Town   Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of in…
Problem description Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly o…
Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and biare not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite space. Let…
[题目链接]:http://codeforces.com/problemset/problem/499/C [题意] 一个平面,被n条直线分成若干个块; 你在其中的某一块,然后你想要要到的终点在另外一个块; 给出起点坐标(x0,y0),终点坐标(x1,y1); 每次你能从一个块移动到相邻的块; 问你最少需要穿过多少条直线,才能到达终点所在的块; [题解] 枚举每一条直线; 如果这两个点在这条直线的两边;(即不在一边); 那么肯定最后是需要穿过这条直线的(才能走在一起); 所以答案递增; 代入一般…
题目链接 给出点A(x1,y1),B(x2,y2),和n条直线(ai,bi,ci,aix + biy + ci = 0),求A到B穿过多少条直线 枚举每条直线判断A.B是否在该直线两侧即可 #include<bits/stdc++.h> using namespace std; #define y1 asodifu double x1,y1,x2,y2; double a,b,c; ; bool check() { if((a*x1+b*y1+c)*(a*x2+b*y2+c)<eps)…
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed…
题目链接:http://codeforces.com/problemset/problem/716/A 题目大意: 输入 n c, 第二行 n 个整数,c表示时间间隔 秒. 每个整数代表是第几秒.如果本次和下一秒间隔>c 则之前的计数次数清0,否则每次输入一个数,计数++: 问最后剩几个数. 举例: input: 6 51 3 8 14 19 20 output: 3 解析: 1 3 8 此时剩 3 个数,因为每次输入距离下次输入时间间隔都<5.下一次是 14 距离上一次 间隔为14-8>…