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

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

We will hold AtCoder Regular Contest 218.

We are looking forward to your participation!

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

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

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 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why is the standing not visible now?

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

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

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

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

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

orz PCTprobability congratulations on LGM.

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

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 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +12 Проголосовать: не нравится

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 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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 месяцев назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

LOL low_cortisol's Atcoder account was banned ^-^

Account Link