Sort by

recency

|

18 Discussions

|

  • + 0 comments

    As a GoPromotional Merchandise Expert, I see "Vertical Rooks" as a dynamic concept perfect for various promotional campaigns. Whether it's representing strength and strategy in a chess-themed event or symbolizing vertical growth in business, the idea can be creatively adapted. Custom branded merchandise like chess sets, notebooks, or corporate gifts inspired by the "Vertical Rooks" theme can engage audiences, showcasing your brand's commitment to innovation, resilience, and smart decision-making in every move.

  • + 0 comments

    Here is problem solution in Python Java C++ and C programming - https://programs.programmingoneonone.com/2021/07/hackerrank-vertical-rooks-problem-solution.html

  • + 0 comments

    If there are any possible VROOKs belonging to the player that has a position to which it can be moved. surah kausar for husband love

  • + 0 comments

    C# short:

    public static string verticalRooks(List<int> r1, List<int> r2)
    {
        return r1.Select((n,i)=>Math.Abs(n-r2.ElementAt(i))-1).Aggregate((cur,next)=>cur^next) == 0 ? "player-1" : "player-2";
    }
    

    ...as always.

  • + 0 comments

    C++ Solution

    #include <bits/stdc++.h>
    
    using namespace std;
    
    const int Nmax = 2e3 + 2;
    
    int A[2 * Nmax];
    int T, N;
    
    int main()
    {
        cin >> T;
    
        while ( T-- )
        {
            cin >> N;
    
            for ( int i = 1; i <= 2 * N; ++i )
                cin >> A[i];
    
            int xorsum = 0;
    
            for ( int i = 1; i <= N; ++i )
                xorsum ^= abs( A[i] - A[i + N] ) - 1;
    
            if ( xorsum )
                cout << "player-2\n";
            else
                cout << "player-1\n";
        }
    
        return 0;
    }