Processing math: 75%
본문 바로가기

수학22

AtCoder ABC 269 풀이 https://atcoder.jp/contests/abc269/tasks Tasks - UNICORN Programming Contest 2022(AtCoder Beginner Contest 269) AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. (a+b)*(c-d)와 문자열 하나를 출력해주면 됩니다. #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d;.. 2022. 9. 18.
백준 22878 / C++ https://www.acmicpc.net/problem/22878 22878번: 간단한 문제 길이가 N인 두 수열 (p1,p2,,pN), (q1,q2,,qN) 이 주어진다. 이때 다음 값을 구하여라. i=1Nj=1Nmin(|pipj|,|qiqj|) www.acmicpc.net [ 풀이 ] 수학문제입니다. 두가지 잘 알려진 식을 이용합니다. 1. max(a, b)+min(a, b)=a+b 2. max(|a|, |b|)= abs((a+b)/2)+abs((a-b)/2) 2번 식은 수직선에서 중점을 잡고 오른쪽 반 칸이 최댓값이므로 쉽게 증명됩니다. 두 식을 이용하면, 식이 pi-p.. 2022. 9. 1.
AtCoder ABC 266 풀이 https://atcoder.jp/contests/abc266/tasks Tasks - AtCoder Beginner Contest 266 AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. 중간 글자를 출력하면 됩니다. #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); string s; cin >> s; cout p인 경우 답은 N%p 입니다. 2) 0> b.x >> b.y; cin >> c.x >> c.y; cin >> d... 2022. 8. 29.
AtCoder ABC 264 풀이 https://atcoder.jp/contests/abc264/tasks Tasks - freee Programming Contest 2022(AtCoder Beginner Contest 264) AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. pass B. 굳이 채우지 않고 규칙성으로 해결해봅시다. 중앙사각형에서 "간격"이 홀수이면 검은색이고 짝수면 흰색입니다. 여기서 간격이란 어떤 칸을 잡았을 때 그 칸을 포함하는 정사각틀과 중앙사각형의 거리입니다. 이 간격은 |R-8|과 |C-8|중 최댓값이 됨을 쉽게 알 수 .. 2022. 8. 27.