Loading...
2024. 4. 14. 02:54

ABC349 D번 복기 - log를 구하는 가장 정확한 방법 - math.log를 기피해야하는 이유

https://atcoder.jp/contests/abc349/tasks/abc349_d D - Divide IntervalAtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online.atcoder.jp  L부터 R-1까지 연속된 정수 수열이 주어질때, 이 수열을 최소 개수의 구간으로 나눌려고 한다 L  $li = 2^{k}(j), ri = 2^{k}(j+1)$을 만족해야한다. 접근은 상당히 잘 했다 현재 시점 L을 기준으로 $L = 2^{k}j$를 만족하는 모든 k를 먼저 찾는다. 이거는 L이 2로 나누어 떨어지면,..

2023. 9. 1. 02:54

각도 구하는 math.atan, math.atan2 사용법 익히기

1. 문제 11371번: The Big Eye in the Sky (acmicpc.net) 11371번: The Big Eye in the Sky For each test case, output to a newline the number of degrees (rounded to the closest integer) to rotate the Eye. Note that each test case is rotating from the x-axis, not from the previous orientation of the Eye. www.acmicpc.net 1사분면 위의 (x,y)가 (0,0)과 양의 x축과 이루는 각도를 구하는 문제 2. 풀이 다음 그림과 같이 (a,b)에 대하여 arctan(b/a)를 구하..