Блог пользователя chokudai

Автор chokudai, история, 3 года назад, По-английски

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!

  • Проголосовать: нравится
  • +37
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

Someone knows good resources for convolution?

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    3 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

    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

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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

    Spoiler
    • »
      »
      »
      3 года назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      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.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve E ?

  • »
    »
    3 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

    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.

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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 !!

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

E was a cute task.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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