Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

### chokudai's blog

By chokudai, history, 3 years ago, We will hold AtCoder Beginner Contest 197（Sponsored by Panasonic）.

The point values will be 100-200-300-400-500-600.

We are looking forward to your participation! Comments (14)
| Write comment?
 » Someone knows good resources for convolution?
 » Can anyone explain how to solve D(The one that involved Geometry)?Link to the Problem
•  » » 3 years ago, # ^ | ← Rev. 2 →   You are supposed to take the first point and rotate it by 180/(n/2) degrees counter-clockwise, around the circle formed by point 1 and point n/2, Center of the circle being mid point between them, radius being the distance between the points/2
 » Can someone provide a test in which this solution fails for D? I've had a really tough time figuring it out (passed 10/18). Thanks. Spoiler#include using namespace std; int main() { int n; cin >> n; long double ang = (n - 2) * 90.0 / n; ang = ang / 360.0 * 2 * M_PI; int x, y, xx, yy; cin >> x >> y >> xx >> yy; long double len = sqrt((xx - x) * (xx - x) + (yy - y) * (yy - y)); long double xr = cos(ang) * len; long double yr = sin(ang) * len; long double ang2 = acos((xx - x) / len); ang2 = (ang2 - ang); cout << setprecision(12) << fixed; cout << (cos(ang2) * xr) + x << ' '; cout << (sin(ang2) * xr) + y << '\n'; return 0; } 
•  » » Does this work? I assume M_PI stands for $\pi$ Spoiler2 0 1 1 0 your code return 1.000000000000 2.000000000000, I feel answer is 0 0
•  » » » 3 years ago, # ^ | ← Rev. 2 →   In input it's stated N >= 4, so this shouldn't be an issue. And yes, you're right M_PI is c++ constant for Pi.EDIT: Nvm, I think you meant 4 instead of 2 in your input, I see my code returns the clockwise direction instead of counter-clockwise. Thanks.
 » How to solve E ?
•  » » 3 years ago, # ^ | ← Rev. 2 →   I was filming some training camp footage for some reason, so you might understand my solution as I was speaking some nonsense while implementing it.
 » Can anyone help me out why my code is Failing for Problem C — ORXOR ll n; ll arr; ll count(ll i, ll ans, ll store) { if(i>n) return ans^store; return min(count(i+1,ans,store|arr[i]),count(i+1,ans^arr[i],0)); } void solve() { cin>>n; for(int i=1; i<=n; ++i) cin>>arr[i]; cout<
•  » » You should change  return min(count(i+1,ans,store|arr[i]),count(i+1,ans^arr[i],0));  into  return min(cnt(i+1,ans,store|arr[i]),cnt(i+1,ans^store,arr[i]));  You can also go to see the official editoral to learn an easier solution.
 » E was a cute task.