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

Автор Dominater069, 12 месяцев назад, По-английски

We invite you to participate in CodeChef’s Starters 188, this Wednesday, 28th May, rated for 6 stars (i.e. for users with rating < 2500).

Time: 8:00 PM — 10:00 PM IST

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here. Hope to see you participating.

Good Luck!


Congratulations to Top $$$5$$$ in Div $$$1$$$:

  • Rank $$$1$$$ : potato167
  • Rank $$$2$$$ : flytime
  • Rank $$$3$$$ : owll
  • Rank $$$4$$$ : loki_x
  • Rank $$$5$$$ : Nachia
  • Проголосовать: нравится
  • +42
  • Проголосовать: не нравится

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How many problems for each division..?

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Contest starts in ~45min.

»
12 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится +34 Проголосовать: не нравится

i am sorry for the last problem in Div1 :(

We were not able to come up with the simple solution that so many people found. All three of me, editorialist and tester found a much harder (and maybe nicer?) solution.

I would ask you to try this version instead:

  • You are given a binary string of $$$0, 1$$$ or $$$?$$$, and you should replace the $$$?$$$ to get the binary representation of $$$X$$$. Now find how many $$$X$$$ exist that satisfy the other constraints. $$$N, D \le 2000$$$.
  • It is also possible to solve the above problem for $$$N \le 10^9, D \le 200$$$, $$$K \le 200$$$, where $$$K$$$ is the number of positions which are not $$$?$$$ in the binary string of $$$X$$$.

You can find our original intended solution at Editorial

»
12 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

Thank you Dominater069 for Swaps in strings. Although I couldn't solve it in contest but the solution is so much lovely. (I was trying to compute each block of ABC independently)

»
12 месяцев назад, скрыть # |
Rev. 3  
Проголосовать: нравится +6 Проголосовать: не нравится
int n, d;

int dp[100][2001];

int f(int till, int rem) {
    if (till == -1) return rem == 0;

    if (dp[till][rem] != -1) return dp[till][rem];

    int ans = f(till - 1, rem);

    int po = (1 << till);
    if (!(po & d)) {
        int req = (rem - po) % d;
        if (req < 0) req += d;

        ans += f(till - 1, req);
        ans %= mod;
    }

    return dp[till][rem] = ans;
}


void solve() {
    range(i, 0, 100) range(j, 0, 2001) dp[i][j] = -1;
    cin >> n >> d;

    int ans = (f(n - 1, 0)) - 1; // subtracting 1 for counting 0.
    ans = (ans + mod) % mod;
    print(ans);
}

What's wrong with this? Getting wrong for the $$$n = 60, d=1800$$$ one. I've lost my mind. Someone, please help.

UPD: I got it. It was due to int overflow. Needed to replace int po = (1 << till); with int po = (1LL << till); -_-

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Request for re-evaluation – hidden tests include extra whitespace

Hi,

I believe the hidden tests for Problem SWAPSTR contain extra whitespace characters that are not described in the statement—characters that were absent from the automatic sample input shown in the “Test against Custom Input” runs during the contest.

In the Python code provided by Editorialist, the condition |S| = N does not hold. https://www.codechef.com/viewsolution/1162787214

Could you please remove those unintended characters and re-evaluate the affected submissions?

Thank you for your time.