problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
acwing::acwing4309类 参考

AcWing 4309. 消灭老鼠 更多...

#include <acwing.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

AcWing 4309. 消灭老鼠

在文件 acwing.h1560 行定义.

成员函数说明

◆ main()

int acwing::acwing4309::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp4944 行定义.

4944 {
4945 int n;
4946 int x0;
4947 int y0;
4948 cin >> n >> x0 >> y0;
4949 bool flag = false;
4950 unordered_set<double> slopes;
4951 for(int i = 0; i < n; i++) {
4952 int xi;
4953 int yi;
4954 cin >> xi >> yi;
4955 if(xi != x0) {
4956 double slope = static_cast<double>(y0 - yi) / (x0 - xi);
4957 slopes.insert(slope);
4958 } else {
4959 flag = true;
4960 }
4961 }
4962 cout << slopes.size() + (flag ? 1 : 0);
4963 return 0;
4964 }

被这些函数引用 acwing::TEST().


该类的文档由以下文件生成: