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

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

We will hold TOYOTA SYSTEMS Programming Contest 2021(AtCoder Beginner Contest 228).

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

We are looking forward to your participation!

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

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

Best of luck everyone!

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

is it hard than regular ABC or it's only for me ?

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

Would be stuck on C if the clarification had not come. I was finding if K rank is possible or not instead of top K. Happened with someone else?

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

I specifically used python for E to avoid overflow but still getting WA. What am I doing wrong here?

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

For task D i used another array of same size consisting of 0s in place of -1 and update it's value to 1 if a positive value is assigned to an index and made range sum query to find the next h having (a[h] == -1). Where am i going wrong? my submission

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

in d i used brute forced passed 18/19 cases got tle in one of it please tell there is only short change or complete another implementation for accepted ones i have got no idea after seeing 1 or 2 solution please also tell how u guys got approach or how u thought thnx in advance

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

Can anyone please explain why

long long n, m, k; cin >> n >> k >> m;
long long x = binpow(k, n, mod - 1);
cout << binpow(m, x + mod - 1, mod);

this passes for all test cases in E

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

In problem E this Binary Exponentiation code gives WA

int pwmd(int n, int m,int mod) {
  int res = 1;
  // n %= mod;     correct ans when this line is added
  while (m > 0) {
    if (m & 1)
      res = (res % mod * n % mod) % mod;
    m >>= 1;
    n = (n % mod * n % mod) % mod;
  }

  return res;
}

it gives the correct answer when I add n %= mod

why is this line needed?

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

Here are the video Solutions to the first 5 problems in case you prefer that.

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

For problem A in the case 0 0 0.The answer is supposed to be NO .How is it possible that it is YES.