啊水题 Uva10167
来源:互联网 发布:知乎品牌开放日 编辑:程序博客网 时间:2024/06/01 10:44
#include <iostream>#include <cstdio>#include <cstring>#include <stdlib.h>#include <string.h>#include <queue>#include <fstream>#include <math.h>using namespace std;int num,cherry[105][2];bool line_ok(int a,int b){ int count =0; for(int i=0;i<num*2;i++) { if(cherry[i][0]*a+cherry[i][1]*b>0){count++;} else if(cherry[i][0]*a+cherry[i][1]*b==0){return false;} } if(count==num){return true;} else {return false;}}void get_ans(){ for(int a=-500;a<=500;a++) { for(int b=-500;b<=500;b++) { if(line_ok(a,b)){cout<<a<<" "<<b<<endl;return;} } }}int main(){ //ifstream cin("ha.txt"); while(cin>>num&&num) { for(int i=0;i<2*num;i++) { cin>>cherry[i][0]>>cherry[i][1]; } get_ans(); }}
0 0
- 啊水题 Uva10167
- uva10167
- uva10167
- UVA10167
- uva10167
- UVA10167
- UVA10167 生日蛋糕
- uva10167 枚举
- uva10167--枚举
- UVA10167-Birthday Cake
- UVA10167- Birthday Cake(生日蛋糕)
- uva10167 生日蛋糕 (枚举)
- UVa10167 Birthday Cake
- Birthday Cake UVA10167
- UVA10167 Birthday Cake
- uva10167 (简单题)
- UVA10167-birthday cake
- uva10167 Birthday Cake
- uva 11637 - Garbage Remembering Exam(概率)
- 非正式协议和合成对象
- 跟我到CPU内部去看1+1=2是如何运行的
- HashMap、TreeMap对象的遍历
- 写给准备参加秋招的学弟学妹们
- 啊水题 Uva10167
- 6.3.3二叉树重建
- 回调函数
- C++函数调用
- Java与C#间json日期格式互转完美解决方案
- linux安全
- javascript中 Date的构造函数 传入规定外的参数的返回值是Invalid Date
- Android SQLite简介
- 找工作开启学霸模式