chokudai's blog

By chokudai, history, 4 years ago, In English

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!

  • Vote: I like it
  • +37
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it -18 Vote: I do not like it

Someone knows good resources for convolution?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain how to solve D(The one that involved Geometry)?Link to the Problem

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    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

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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
  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Does this work? I assume M_PI stands for $$$\pi$$$

    Spoiler
    • »
      »
      »
      4 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      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.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve E ?

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    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.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Can anyone help me out why my code is Failing for Problem C — ORXOR

ll n;
ll arr[25];
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<<count(1,0,0);
}

I simply recurse over all possible combinations taking the minimum, i.e at every index i, We have two possibilities either include it in sequence or partition and start a new sequence from here.

Thanks a Lot !!

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

E was a cute task.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain the idea of "build new graph" in problem F?Thanks in advance

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How to do problem F? My solution which is quite a mess because maybe I don't understand properly how to construct the graph? I used a map to assign node numbers to the pairs so that its easier to construct the adjacency list. Can someone help me?I am really stuck now :( UPD: IGNORE!! It was a stupid mistake