打卡信奥刷题(318)用Scratch图形化工具信奥P2665 [普及组/提高组] [USACO08FEB] Game of Lines S
创始人
2025-01-08 18:36:41
0

[USACO08FEB] Game of Lines S

题目背景

Farmer John 最近发明了一个游戏,来考验自命不凡的贝茜。

题目描述

Farmer John has challenged Bessie to the following game: FJ has a board with dots marked at N (2 ≤ N ≤ 200) distinct lattice points. Dot i has the integer coordinates Xi and Yi (-1,000 ≤ Xi ≤ 1,000; -1,000 ≤ Yi ≤ 1,000).

Bessie can score a point in the game by picking two of the dots and drawing a straight line between them; however, she is not allowed to draw a line if she has already drawn another line that is parallel to that line. Bessie would like to know her chances of winning, so she has asked you to help find the maximum score she can obtain.

游戏开始的时 候,FJ 会给贝茜一块画着 N ( 2 ≤ N ≤ 200 ) N (2 \le N \le 200) N(2≤N≤200) 个不重合的点的木板,其中第 i i i 个点的横、纵坐标分别为 X i X_i Xi​ 和 Y i ( − 1000 ≤ X i ≤ 1000 , − 1000 ≤ Y i ≤ 1000 ) Y_i (-1000 \le X_i \le 1000, -1000 \le Y_i \le 1000) Yi​(−1000≤Xi​≤1000,−1000≤Yi​≤1000)。

贝茜可以选两个点画一条过它们的直线,当且仅当平面上不存在与画出直线 平行的直线。游戏结束时贝茜的得分,就是她画出的直线的总条数。为了在游戏中胜出,贝茜找到了你,希望你帮她计算一下最大可能得分。

输入格式

第 1 1 1 行: 输入 1 个正整数: N N N

第 2 ⋯ N + 1 2 \cdots N+1 2⋯N+1 行: 第 i + 1 i+1 i+1 行用 2 2 2 个用空格隔开的整数 X i , Y i X_i,Y_i Xi​,Yi​,描述了点 i i i 的坐标。

输出格式

第 1 行: 输出 1 个整数,表示贝茜的最大得分,即她能画出的互不平行的线段数

样例 #1

样例输入 #1

4  -1 1  -2 0  0 0  1 1 

样例输出 #1

4 

提示

贝茜能画出以下 4 4 4 种斜率的直线: − 1 -1 −1, 0 0 0, 1 3 \dfrac{1}{3} 31​ 以及 1 1 1。

Scratch实现

在这里插入图片描述

后续

接下来我会不断用scratch来实现信奥比赛中的算法题、Scratch考级编程题实现、白名单赛事考题实现,感兴趣的请关注,我后续将继续分享相关内容

相关内容

热门资讯

WPK透视辅助!德州局脚本,w... WPK透视辅助!德州局脚本,wpk德州局透视(切实是有挂)1、超多福利:超高返利,海量正版游戏,wp...
微扑克透视辅助!pokemmo... 微扑克透视辅助!pokemmo辅助器手机版下载,hhpoker开挂教程(一贯是真的有挂)1、微扑克透...
WPK透视辅助!扑克之星辅助,... WPK透视辅助!扑克之星辅助,wepoker辅助是真的假的(真是真的有挂)wepoker辅助是真的假...
wpk透视辅助!hhpoker... wpk透视辅助!hhpoker是内部控制吗,wepoker破解工具(好像真的有挂)1、hhpoker...
微扑克透视辅助!hhpoker... 微扑克透视辅助!hhpoker德州透视,xpoker透视辅助(好像真的是有挂)1)hhpoker德州...
微扑克透视辅助!黑侠破解wep... 微扑克透视辅助!黑侠破解wepoker,wepoker辅助分析器(切实是有挂)1、首先打开wepok...
wpk透视辅助!aapoker... wpk透视辅助!aapoker怎么设置抽水,大菠萝手游辅助(总是真的有挂)运aapoker怎么设置抽...
wpk透视辅助!wepoker... wpk透视辅助!wepoker软件辅助程序,wepoker辅助器安装包定制(其实是有挂)小薇(辅助器...
微扑克透视辅助!aapoker... 微扑克透视辅助!aapoker怎么提高中牌率,hhpoker软件安装包(确实真的有挂)1、进入游戏-...
WPK透视辅助!wepoker... 您好,wepoker透视器免费这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054...