当前位置:网站首页>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;
}
边栏推荐
- Let Baidu collect, crawler own website
- 容器跑不动?网络可不背锅
- CPU and GPU are out of date, and the era of NPU and APU begins
- Verilog implementation of key dithering elimination
- Find my technology | the Internet of things asset tracking market has reached US $6.6 billion, and find my helps the market develop
- PHP save array to var file_ export、serialize
- PHP 对象转换数组
- Uncaught TypeError: $(...). Onmousenter is not a function JS error, solution:
- 【Unity3d Shader】角色投影与倒影
- 安装VMware报错failed to install the hcmon driver
猜你喜欢

Summary of senior report development experience: understand this and do not make bad reports

Testing is not valued? Senior: you should think in another position

加班一周开发了报表系统,这个低代码免费IT报表神器太好用了

【程序员必备】七夕表白攻略:”月遇从云,花遇和风,晚上的夜空很美“。(附源码合集)

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

KBPC1510-ASEMI大芯片15A整流桥KBPC1510
![[unity3d shader] character projection and reflection](/img/00/d0d994d88475ea590dc5cb60a6ad65.png)
[unity3d shader] character projection and reflection

《opencv学习笔记》-- 重映射

waf详解

座椅/安全配置升级 新款沃尔沃S90行政体验到位了吗
随机推荐
Kbpc1510-asemi large chip 15A rectifier bridge kbpc1510
Find My技术|物联网资产跟踪市场规模达66亿美元,Find My助力市场发展
Redis如何实现持久化?详细讲解AOF触发机制及其优缺点,带你快速掌握AOF
UFS Clk Gate介绍
Find my technology | the Internet of things asset tracking market has reached US $6.6 billion, and find my helps the market develop
Verilog implementation of key dithering elimination
涂鸦幻彩产品开发包如何使用
Operator new, operator delete supplementary handouts
5 years, 1.4W times, NFT og's road to immortality Web3 column
PHP 对象转换数组
Visio: how do Gantt charts merge cells? Solution: overwrite cells
In PHP, you can use the abs() function to turn negative numbers into positive numbers
PHP connects to MySQL database, and database connects to static tool classes to simplify the connection.
(翻译)按钮位置约定能强化用户使用习惯
Introduction to UFS CLK gate
Chinese database oceanbase was selected into the Forrester translational data platform report
PHP < => spacecraft operator (combined comparator)
ZK snark: about private key, ring signature, zkksp
[Reading Notes - > data analysis] 01 introduction to data analysis
想要做好软件测试,可以先了解AST、SCA和渗透测试