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

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

We invite you to participate in CodeChef’s Starters 177, this Wednesday, 12th March, rated upto 5 stars (i.e. for users with rating < 2200).

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!

UPD : The number of problems in each division is as follows:

  • Division $$$1$$$ : $$$6$$$ problems
  • Division $$$2$$$ : $$$7$$$ problems
  • Division $$$3$$$ & $$$4$$$ : $$$8$$$ problems

UPD 2 : Congratulations to the winners:

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

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

Dominater round after so long

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

hope to have some fun with the problems .

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

is the problem blocktree , perfect subset sum ?

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

i am sorry for the weak samples on Matching Arrays.

I expected the problem to be much easier than it ended up being. The correct decision was indeed a stronger sample.

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

    Off-topic, but who are the 6 and 7 star north korean users?
    Many of them are never mentioned in the list of top 5 winners. I assume this is due to their cheating being pretty transparent. I distinctly remember one of them beating the lgm nachia in one of the contests. Was AI really able to solve all those problems? Their coding styles also seem legit.
    So, how are they cheating?

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

    I would say samples are used to help understand the problem statement. Weak samples are ok as long as this is in a full feedback contest.

    I also got it wrong 2 times, but Wrong Answer forced me to re-think if my solution is wrong.

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

In the problem SUMBYOR , the test cases are weak as the number of distinct possible numbers are close to 32000. But i have seen accepted codes with time complexity as big as O(32000^2). The code given below is accepted.

#include <bits/stdc++.h>
using namespace std;

#define int long long

const int MAX_N = 200000;

int getBitMask(int num) {
    int mask = 0;
    for (int i = 0; i<30; i++) {
        if (num & (1LL << i)) {
            mask |= (1 << i);
        }
    }
    return mask;
}

void solve() {
    int n; cin >> n;
    map<int, int> freq;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        int mask = getBitMask(a[i]);
        freq[mask]++;
    }
    vector<pair<int, int>> masks(freq.begin(), freq.end());

    int sum=0, pref=0, ct=0;
    for (int i = 0; i < masks.size(); i++) {
        int mski = masks[i].first;
        int cti = masks[i].second;
        sum += (cti*(cti-1)/2)*2;
        for(int j = i + 1; j < masks.size(); j++) {
            int maskj = masks[j].first;
            int ctj = masks[j].second;
            if ((mski & maskj) == 0) {
                sum += cti * ctj * 1;
            } else {
                sum += cti * ctj * 2;
            }
        }
    }
    cout<<sum<<endl;
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while (T--) {
        solve();
    }

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

Why constraints of $$$blocks \ on \ tree$$$ is less? For checker? But still checker can be done in $$$O(n)$$$