atcoder_official's blog

By atcoder_official, history, 7 months ago, In English

We will hold AtCoder Regular Contest 218.

We are looking forward to your participation!

  • Vote: I like it
  • -31
  • Vote: I do not like it

»
7 months ago, hide # |
 
Vote: I like it +104 Vote: I do not like it

I tried hard to recall when the last AtCoder official contest had a task with a partial score and realized I was still a primary school student then.

»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why is the standing not visible now?

»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is the meaning of (700+300)? I haven't seen it in ARC before.

»
7 months ago, hide # |
 
Vote: I like it -23 Vote: I do not like it

Does Problem F have partial scores? Or will it be divided into sub-tasks?

»
7 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

orz PCTprobability congratulations on LGM.

»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve D? I know how to solve for all suffixes in $$$O(n)$$$, but I don't see a way to extend that to arbitrary intervals

»
7 months ago, hide # |
← Rev. 2  
Vote: I like it +12 Vote: I do not like it

vaibhavyadavv32 Please care to elaborate about Farkas' lemma used by you in Problem F. Guess what; I am damn sure, you don't even realise you have used that.

CF and AC, please ban this user. And all of those who have downvoted on my previous comment for no reason; please try to make this community more inclusive and welcoming. Thanking all of you.

»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Getting TLE in A:

Isn't the complexity of my code O(N^2 M) ?

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

#define long long long

const long mod = 998244353;

long mpow(long a, long b) {
    if (!b) return 1LL;
    long ans = mpow(a, b >> 1);
    ans = (ans * ans) % mod;
    if (b & 1LL) ans = (ans * a) % mod;
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> a(n + 1, vector<int>(m + 1));
    vector<unordered_map<int, int>> cnt(n + 1);
    unordered_map<int, int> total_count;
    vector<int> uniq_vec;
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            cin >> a[i][j];
            if (total_count[a[i][j]] == 0) {
                uniq_vec.push_back(a[i][j]);
                total_count[a[i][j]] = 1;
            }
            cnt[i][a[i][j]]++;
        }
    }
    long ans = mpow(m, n);
    ans *= uniq_vec.size();
    ans %= mod;
    long sum = 0;
    for (int x : uniq_vec) {
        long xx = 1LL;
        for (int i = 1; i <= n; ++i) {
            xx *= m - cnt[i][x];
            xx %= mod;
        }
        sum += xx;
        sum %= mod;
    }
    ans -= sum;
    ans %= mod;
    if (ans < 0LL) ans += mod;
    cout << ans << "\n";
    return 0;
}

Thanks

»
7 months ago, hide # |
 
Vote: I like it +33 Vote: I do not like it

LOL low_cortisol's Atcoder account was banned ^-^

Account Link