전체 글188 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. AtCoder ABC 265 풀이 A. 1개살때 X원, 3개살때 Y원이 들때 N개살때 최소비용을 구하는 문제입니다. 우선, Y가 3X이상이면 그냥 다 1개씩 사면 됩니다. 그 외의 경우엔 3개씩 최대한 묶고 남은걸 1개씩 사주면 됩니다. #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); int x, y, N; cin >> x >> y >> N; if (y >= 3 * x) { cout n >> m >> t; for (int i = 1; i > a[i]; psum[i + 1] = psum[i] + a[i]; } ll time_limit = t; x[0] = 1; for (int i = 1; i > x[i] >> y[i.. 2022. 8. 25. FFT 코드 [ Code ] using cpx = complex; using vec = vector; const double PI = acos(-1); void FFT(vec& f, bool inv) { int n = f.size(); for (int i = 1, j = 0; i > 1; while (!((j ^= bit) & bit)) bit >>= 1; if (i < j) swap(f[i], f[j]); } for (int i = 1; i < n; i 2022. 8. 23. 백준 23878 / C++ https://www.acmicpc.net/problem/23878 23878번: Lonely Photo Farmer John has recently acquired $N$ new cows $(3 \le N \le 5 \times 10^5)$, each of whose breed is either Guernsey or Holstein. The cows are currently standing in a line, and Farmer John wants take a photo of every sequence of three or more consecutive c www.acmicpc.net [ 풀이 ] 아이디어는 쉽습니다. 연속된 G끼리, H끼리 묶어서 개수를 구해줍니다. 우선 연속된 G를 기준으로 세봅시다.. 2022. 8. 23. 이전 1 ··· 30 31 32 33 34 35 36 ··· 47 다음