当前位置:网站首页>[acwing weekly rematch] 61st weekly 20220723
[acwing weekly rematch] 61st weekly 20220723
2022-07-25 00:02:00 【Seven water Shuliang】
[acwing Weekly replay ] The first 61 Weekly match 20220723
One 、 Summary of this week's race
- The third question is geometry , First, I pushed the formula for half a day on the draft paper , Go to the scene again python How to keep a few decimal places .
- In the end wa Half day .
- And the answer to the third question is not unique .


Two 、 4497. Divide candy
link : 4497. Divide candy
1. Title Description

2. Thought analysis
grading Easy.
Sign in problem , Just hard write .
3. Code implementation
import io
import os
import sys
from collections import deque
if os.getenv('LOCALTESTACWING'):
sys.stdin = open('input.txt')
if __name__ == '__main__':
T = int(input())
for _ in range(T):
a,b,c = map(int, input().split())
print((a+b+c)//2)
3、 ... and 、4498. The pointer
link : 4498. The pointer
1. Title Description

2. Thought analysis
- At first, there was no good idea , Look at the data range 15, So directly dfs enumeration .
3. Code implementation
import io
import os
import sys
from collections import deque
if os.getenv('LOCALTESTACWING'):
sys.stdin = open('input.txt')
if __name__ == '__main__':
n = int(input())
arr = []
for _ in range(n):
arr.append(int(input()))
m = len(arr)
def dfs(index, s):
if index == m:
if s % 360 == 0:
return True
return False
if dfs(index + 1, s + arr[index]):
return True
return dfs(index + 1, s - arr[index])
print('YES' if dfs(0, 0) else 'NO')
Four 、4499. A circle
link : 4499. A circle
1. Title Description

2. Thought analysis
Geometry problems .
- Condition one means that your circle should be in a given circle (x1,y1,R) Inside .
- Condition 2 means that your circle cannot cover a given point (x2,y2), But you can touch ( Fix it ).
- Condition three means that your circle should be as big as possible , In other words, your circle should expand vigorously against this point .
- Special judgment if the given point is not in the circle , Then the circle we can construct is the given circle , Directly adjust the decimal point output .
- If in a circle , And the center of the circle , Then our circle diameter is the radius of a given circle , Obviously, the position of the center of the circle can be taken casually by rolling around the given center of the circle , Unlimited possibilities , Here is the y Fix .
- The rest of the case requires a set of formulas , You can see the picture below me , The code directly sets the conclusion .
3. Code implementation
import io
import os
import sys
from collections import deque
if os.getenv('LOCALTESTACWING'):
sys.stdin = open('input.txt')
def sovle(R, x1, y1, x2, y2):
if (y1 - y2) ** 2 + (x1 - x2) ** 2 >= R ** 2:
return print("%.6f" % (x1 * 1.0), "%.6f" % (y1 * 1.0), "%.6f" % (R * 1.0))
if x1 == x2 and y1 == y2:
return print("%.6f" % ((x1 + R/2) ), "%.6f" % (y1 * 1.0), "%.6f" % (R / 2))
c = ((y1 - y2) ** 2 + (x1 - x2) ** 2) ** 0.5
c2 = c + R
y3 = (y2 - c2 * (y2 - y1) / c)
x3 = (x2 - c2 * (x2 - x1) / c)
y4 = (y3 + y2) / 2
x4 = (x3 + x2) / 2
r = c2 / 2
print("%.6f" % x4, "%.6f" % y4, "%.6f" % r)
if __name__ == '__main__':
R, x1, y1, x2, y2 = map(int, input().split())
sovle(R, x1, y1, x2, y2)
6、 ... and 、 Reference link
- nothing
边栏推荐
- Two numbers that appear only once in the array
- Mandatory interview questions: 1. shallow copy and deep copy_ Deep copy
- Pit record: typeerror:'module'object is not callable
- Advanced function of postman
- Paper notes: accurate causal influence on discrete data
- 4. Immersion test
- Salesforce zero foundation learning (116) workflow - & gt; On flow
- How painful is it to write unit tests? Can you do it
- JS ------ Chapter 3 JS cycle
- Grafana - influxdb visual K6 output
猜你喜欢

Go basic notes_ 4_ map

Processing PDF and JPG files in VB6

数组中只出现一次的两个数字
![[untitled]](/img/8a/c51328240e28459e98aedcf107c0a3.png)
[untitled]

Leetcode 1260. two dimensional grid migration: two solutions (k simulations / one step)

2. Load test

2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case

2022 Henan Mengxin League game 2: Henan University of technology K - Rice

Go基础笔记_4_map

Advanced function of postman
随机推荐
Install software on kubernetes cluster using helm 3 package manager
cloud chart
Install K6 test tool
Remember the problem of using redisson to step on the pit once
91. (leaflet chapter) leaflet situation plotting - offensive direction drawing
Upload and download filask files
Browser cache
With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code
LP liquidity pledge mining system development detailed procedure
Leetcode 0125. validate palindrome string
Do you need to open an account to buy a wealth management product with a 6% income?
Transmission download list, download file migration machine guide
JS ------ Chapter 3 JS cycle
痛并快乐的-NIO编程
[acwing周赛复盘] 第 61 场周赛20220723
Only by learning these JMeter plug-ins can we design complex performance test scenarios
线段树杂谈
Use of serial queues
Go basic notes_ 4_ map
ROS机械臂 Movelt 学习笔记3 | kinect360相机(v1)相关配置