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

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

We will hold Tokio Marine & Nichido Fire Insurance Programming Contest 2025 (AtCoder Beginner Contest 402).

We are looking forward to your participation!

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

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

Impossible to log in into AtCoder, Cloudflare blocks. Uncaught TurnstileError: [Cloudflare Turnstile] Error: 300010. at g (api.js:1:11022) at N (api.js:1:36515) Formerly Refused to execute script from 'https://pp.d2-apps.net/v1/impressions/log?client_id=468&site_url=https%3A%2F%2Fatcoder.jp%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fatcoder.jp%252F&referer=https%3A%2F%2Fatcoder.jp%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fatcoder.jp%252F&__version=1.0.0&__ord=2140118752267&callback=__pfunc&viewport=1920x945&language=en-US&first_party_uid=WRJEn4pqIfj9yqrrFDFvSXGNgGO3MW7j&local_storage_uid=hX3FbroDtZwaE62uYdn15cdPts4ZSyz5&c_1=atcodercontest&c_2=ClientSite' because its MIME type ('image/gif') is not executable. At advice by ChatGPT, blocked pp.d2-apps.net in the hosts file. It worked for one hour, and than the problems came back

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

Hope to solve ABCDEF.

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

Seems that AtCoder is experiencing tough condition every time when the competition's sponsor is Tokio Marine & Nichido Fire Insurance. Hope that this round will be Rated.

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

when 20:30(UTF+8):

pE4NzT0.png

Funny. It seems that ABC has become a "copy paste modify chatgpt code" contest.

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

Another speedcoder. Only 5 passed G but ~1000 passed F.

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

$$$O(T\sqrt n)$$$ solution is able to pass G. I think the constraints should have been made to $$$10^9$$$ or so.

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

what is problem with my implementation for E, my approach is similar to the editorial

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

    Your DP table is undersized. you declared it as vector<vector>(1<<8, vector(5000, -1.0)) but since x can be up to 5000 you end up indexing dp[...][5000] on a vector that only goes 0–4999, Just size the second dimension to X+1 so it covers 0 through X inclusive.

    Second, you never guard against overspending: you compute

    double cand = p*(s + solve(nxt, x-c)) + (1-p)*solve(his, x-c);

    even when c > x. Both calls then see a negative budgete and return 0 giving you an illegal “free” gain of p * s To fix it : before recursing skip any problem you can’t afford:

    if (c > x) continue;

  • »
    »
    17 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится
    #include <bits/stdc++.h>
    using namespace std;
    
    #define int long long
    #define pb push_back
    #define all(v) v.begin(), v.end()
    #define sz(v) ((int)(v).size())
    #define pii pair<int, int>
    #define vi vector<int>
    #define vpii vector<pii>
    #define F first
    #define S second
    #define endl '\n'
    
    const int MOD = 1e9 + 7;
    const int INF = 1e18;
    
    int n, X;
    vector<vector<double>> dp;
    vector<vector<int>> v;
    
    double dfs(int mask, int rem) {
        if (rem == 0) return 0.0;
        if (dp[mask][rem] > -0.5)return dp[mask][rem];
    
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (mask & (1<<i)) continue;
            int c = v[i][1];
            if (c > rem) continue;      
            double p = v[i][2] / 100.0;
            double s = v[i][0];
            int nxt = mask |(1<<i);
    
            double take = p * (s + dfs(nxt, rem - c)) + (1 - p) *dfs(mask, rem - c);
            ans = max(ans, take);
        }
    
        return dp[mask][rem] = ans;
    }
    
    void solve() {
        cin >> n >> X;
        v.assign(n, vector<int>(3));
        for (int i = 0; i < n; i++)
            cin >> v[i][0]>> v[i][1] >> v[i][2];
    
        dp.assign(1<<n, vector<double>(X+1, -1.0));
        for (int mask = 0; mask < (1<<n); mask++)
            dp[mask][0] = 0.0;
    
        cout << fixed << setprecision(10)
             << dfs(0, X) << endl;
    }
    
    int32_t main() {
    
        int t = 1;
        while (t--) solve();
        return 0;
    }
    
    
    
»
17 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

what is wrong with this code for problem C — https://atcoder.jp/contests/abc402/submissions/65031146 ??

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

Why This code for F should use long long.

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

In problem d. If we have an odd number of points, wouldn't every line intersect? I believe there will not be any parallel line.