当前位置:网站首页>#yyds干货盘点# 解决名企真题:交叉线
#yyds干货盘点# 解决名企真题:交叉线
2022-07-07 12:42:00 【51CTO】
1.简述:
大M布置给小M一个题目:首先给出n个在横坐标上的点,然后连续的用半圆连接他们:首先连接第一个点与第二点(以第一个点和第二点作为半圆的直径)。然后连接第二个第三个点,直到第n个点。现在需要判定这些半圆是否相交了,在端点处相交不算半圆相交。如下图所示。

输入的第一行包含一个整数T (1 ≤ T ≤ 10)表示有T组样例。每组样例的第一行是一个整数n (1≤n≤1000)。接下来的一行输入有n个用空格隔开的不同的整数a1,a2,...,an (-1000000 ≤ ai ≤ 1000000),(ai,0)表示第i个点在横坐标的位置。
对于每个输入文件,输出T行。每行输出"y"表示这些半圆有相交或者"n"。
输入:
输出:
2.代码实现:
边栏推荐
- Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
- 关于后台动态模板添加内容的总结 Builder使用
- 2022pagc Golden Sail award | rongyun won the "outstanding product technology service provider of the year"
- 今日睡眠质量记录78分
- Leetcode one question per day (636. exclusive time of functions)
- Demis Hassabis谈AlphaFold未来目标
- 杭电oj2054 A == B ? ???
- Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
- Vscode configuration uses pylint syntax checker
- WebRTC 音频抗弱网技术(上)
猜你喜欢
随机推荐
Base64 encoding
PLC:自动纠正数据集噪声,来洗洗数据集吧 | ICLR 2021 Spotlight
课设之百万数据文档存取
Es log error appreciation -trying to create too many buckets
Cascading update with Oracle trigger
Simple steps for modifying IP of sigang electronic scale
Notes de l'imprimante substance: paramètres pour les affichages Multi - écrans et multi - Résolutions
OAuth 2.0 + JWT 保护API安全
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Cvpr2022 | backdoor attack based on frequency injection in medical image analysis
Similarities and differences between switches and routers
Cocos creator direction and angle conversion
Emqx 5.0 release: open source Internet of things message server with single cluster supporting 100million mqtt connections
PLC: automatically correct the data set noise, wash the data set | ICLR 2021 spotlight
EMQX 5.0 发布:单集群支持 1 亿 MQTT 连接的开源物联网消息服务器
PyTorch模型训练实战技巧,突破速度瓶颈
Leetcode——236. 二叉树的最近公共祖先
MLGO:Google AI发布工业级编译器优化机器学习框架
The method of parsing PHP to jump out of the loop and the difference between continue, break and exit
WPF DataGrid realizes the UI interface to respond to a data change in a single line









