Codeforces Round #284 (Div. 2) C题(计算几何)解题报告
简要题意:
给出两个点的坐标,以及一些一般直线方程Ax+B+C=0的A、B、C,这些直线作为街道,求从一点走到另一点需要跨越的街道数。(两点都不在街道上)
思路分析:
从一点到另一点必须要跨的街道等价于两点一点在这条直线一侧,另一条在另一侧。只需要将两点坐标带进去,一正一负即可。将这些直线依次检验,统计总和。
#include<stdio.h>
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
int main()
{
ll x1,x2,y1,y2,n,a,b,c,s,q,ans=;
scanf("%I64d%I64d",&x1,&y1);
scanf("%I64d%I64d",&x2,&y2);
scanf("%I64d",&n);
while(n--)
{
scanf("%I64d%I64d%I64d",&a,&b,&c);
s=a*x1+b*y1+c;
q=a*x2+b*y2+c;
if((s>&&q<)||(s<&&q>))
ans++;
}
printf("%I64d\n",ans);
return ;
}
Codeforces Round #284 (Div. 2) C题(计算几何)解题报告的更多相关文章
- Codeforces Round #335 (Div. 2)B. Testing Robots解题报告
B. Testin ...
- Codeforces Round #378 (Div. 2) D题(data structure)解题报告
题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常 ...
- Codeforces Round #612 (Div. 2) 前四题题解
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...
- Codeforces Round #713 (Div. 3)AB题
Codeforces Round #713 (Div. 3) Editorial 记录一下自己写的前二题本人比较菜 A. Spy Detected! You are given an array a ...
- Codeforces Round #552 (Div. 3) A题
题目网址:http://codeforces.com/contest/1154/problem/ 题目意思:就是给你四个数,这四个数是a+b,a+c,b+c,a+b+c,次序未知要反求出a,b,c,d ...
- Codeforces Round #284 (Div. 2)A B C 模拟 数学
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #412 Div. 2 补题 D. Dynamic Problem Scoring
D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input s ...
- Codeforces Round #257 (Div. 2) E题:Jzzhu and Apples 模拟
E. Jzzhu and Apples time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #284 (Div. 1) A. Crazy Town 计算几何
A. Crazy Town 题目连接: http://codeforces.com/contest/498/problem/A Description Crazy Town is a plane on ...
随机推荐
- 高通android开发缩写
1.TLMM MSM TLMM pinmux controller,Qualcomm MSM integrates a GPIO and Pin mux/config hardware, (TOP L ...
- [CF752E]Santa Claus and Tangerines(二分答案,dp)
题目链接:http://codeforces.com/contest/752/problem/E 题意:给n个橘子,每个橘子a(i)片,要分给k个人,问每个人最多分多少片.每个橘子每次对半分,偶数的话 ...
- Codeforces 722C. Destroying Array
C. Destroying Array time limit per test 1 second memory limit per test 256 megabytes input standard ...
- python成长之路【第十三篇】:Python操作MySQL之pymysql
对于Python操作MySQL主要使用两种方式: 原生模块 pymsql ORM框架 SQLAchemy pymsql pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎 ...
- Greenlets间如何实现互相通信?
Greenlets互相通信之Event 1.为什么引入Event: 2.Event是什么: 3.编程实例. 为什么引入Event 1.windows中有Events,作为线程间同步的方法: 2.Gev ...
- drupal字段值的规律
field_abc,则会出现field_data_field_abc这样一个表,然后有entity_id这个字段,然后有field_abc_value或者field_abc_target_id,或者f ...
- oracle 存储过程创建及执行简单实例
1. 创建 CREATE OR REPLACE PROCEDURE getAplage(eNo IN NUMBER,salary OUT NUMBER) AS BEGIN SELECT AplAge ...
- m.Tomcat使用openssl走APR通道配置单向和双向认证
引用自: http://blog.csdn.net/gtuu0123/article/details/5827800(Tomcat的SSL单向认证) http://blog.csdn.net/gtu ...
- ActiveReport 同一单元格内图片跟文字按条件显示
ActiveReports支持提供Image控件来显示图片素材,Image控件的值可以为图像的二进制流,图像路径,或url等:而在很多情况下,图片是签名扫描文件,并不会一直有值.如果图片的值为空,则显 ...
- centos mysql 安装及配置
安装Mysql 1 Centos 6.6下安装Mysql很简单, yum list mysql-server 2 当只有一个时候就可以直接 yum install mysql-server 进行安 ...