当前位置:网站首页>Acwing第 61 场周赛【完结】
Acwing第 61 场周赛【完结】
2022-07-26 04:00:00 【辉小歌】
https://www.acwing.com/activity/content/competition/problem_list/2079/
T3,向量知识点有点忘了。
4497. 分糖果
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
int main(void)
{
LL t,a,b,c; cin>>t;
while(t--)
{
cin>>a>>b>>c;
cout<<(a+b+c)/2<<'\n';
}
return 0;
}
4498. 指针【二进制枚举】
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int N=25;
int a[N],n,flag;
int main(void)
{
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
for(int i=0;i<(1<<n);i++)
{
int sum=0;
for(int j=0;j<n;j++)
{
if(i>>j&1) sum=(sum+a[j])%360;
else sum=(sum-a[j]+360)%360;
}
if(!sum) flag=1;
}
if(flag) puts("YES");
else puts("NO");
return 0;
}
4499. 画圆【计算几何】

#include<bits/stdc++.h>
using namespace std;
const double eps=1e-8;
int cmp(double x, double y)
{
if (fabs(x - y) < eps) return 0;
if (x < y) return -1;
return 1;
}
int main(void)
{
double r,x,y,x1,y1;
cin>>r>>x>>y>>x1>>y1;
double dx=x1-x;
double dy=y1-y;
double d=sqrt(dx*dx+dy*dy);
if(cmp(d,r)>=0) printf("%.6lf %.6lf %.6lf",x,y,r);
else
{
if(!cmp(x,x1)&&!cmp(y,y1)) printf("%.6lf %.6lf %.6lf",x+r/2,y,r/2);
else
{
double len=(r+d)/2;
double ans1=x1+(x-x1)/d*len;
double ans2=y1+(y-y1)/d*len;
printf("%.6lf %.6lf %.6lf",ans1,ans2,len);
}
}
return 0;
}
边栏推荐
- Dracoo master
- PHP method to find the location of session storage file
- 【读书笔记->数据分析】01 数据分析导论
- Asemi rectifier bridge gbu1510 parameters, gbu1510 specifications, gbu1510 package
- Idea2020.3.1 cannot be opened (double click cannot be opened), but it can be opened through idea.bat.
- [MCU simulation project] external interrupt 0 controls 8 LED flashes
- 软考 系统架构设计师 简明教程 | 案例分析解题技巧
- 研发了 5 年的时序数据库,到底要解决什么问题?
- 《opencv学习笔记》-- 霍夫变换
- 2.9.4 Ext JS的布尔对象类型处理及便捷方法
猜你喜欢

STM32状态机编程实例——全自动洗衣机(下)

Three ways of redis cluster

How to use graffiti magic color product development kit

6年从零开始的自动化测试之路,开发转测试我不后悔...

Moco V2: further upgrade of Moco series

座椅/安全配置升级 新款沃尔沃S90行政体验到位了吗

The convolution kernel is expanded to 51x51, and the new CNN architecture slak counterattacks the transformer

安装VMware报错failed to install the hcmon driver

Redis如何实现持久化?详细讲解AOF触发机制及其优缺点,带你快速掌握AOF

Dracoo Master天龙卡牌大师
随机推荐
ACM mm 2022 | end to end multi granularity comparative learning for video text retrieval
File upload error: current request is not a multipart request
Analysis on the infectious problem of open source license
STM32状态机编程实例——全自动洗衣机(下)
[Reading Notes - > data analysis] 01 introduction to data analysis
PHP method to find the location of session storage file
苹果在其产品中拿掉了最后一颗Intel芯片
php中可以使用取绝对值函数 abs() 将负数转成正数
电商运营小白,如何快速入门学习数据分析?
[MCU simulation project] external interrupt 0 and 1 control two digit nixie tube to count
Realization of online shopping mall system based on JSP
【单片机仿真项目】外部中断0控制8个发光二极管闪烁
微信小程序实现音乐播放器(4)(使用pubsubjs实现页面间通信)
The PHP Eval () function can run a string as PHP code
Dracoo Master天龙卡牌大师
cpu和gpu已过时,npu和apu的时代开始
Operator new, operator delete supplementary handouts
安装VMware报错failed to install the hcmon driver
JS Base64 encoding and decoding
Leetcode: 102. Sequence traversal of binary tree