Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2), problem: (D) Field expansion Solution In C/C++

By |2017-07-24T13:26:00+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include <bits/stdc++.h> using namespace std; typedef int64_t ll; #define f(i,j,k) for(int i=j;i<k;i++) const int maxn = 1e5 + 10; int A[maxn], a,b,h,w,n,ans; void dfs(ll aa, ll bb, int cnt) { if (cnt==n+1) return; if (aa>=a && bb>=b) ans=min(ans,cnt); if (A[cnt]==2) { while (aa<a) aa*=2, [...]