atcoder_official's blog

By atcoder_official, history, 14 months ago, In English

We will hold AtCoder Beginner Contest 396.

We are looking forward to your participation!

  • Vote: I like it
  • +9
  • Vote: I do not like it

| Write comment?
»
14 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hope i don't choke myself on triple pointer questions again

»
14 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I am looking forward to it!!!

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

I am a Chinese. And you?

»
14 months ago, hide # |
 
Vote: I like it +67 Vote: I do not like it

I want to report user InequalityHanXu used AI (DeepSeek) to solve task G; please ban the user!

I believe many people used AI because their code is very similar.

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

Please help me hack this code:

#include <bits/stdc++.h>
#define __Made return
#define in 0
#define China__ ;
using namespace std;

int n, m;
long long b[200005], w[200005];
int p1 = 1, p2 = 1;
long long ans;

bool cmp(long long x, long long y) {
    return x > y;
}

int main()
{
    scanf("%d %d", &n, &m);
    for(int i = 1; i <= n; i++) scanf("%lld", &b[i]);
    for(int i = 1; i <= m; i++) scanf("%lld", &w[i]);
    sort(b + 1, b + n + 1, cmp);
    sort(w + 1, w + m + 1, cmp);
    while(b[p1] > 0 && w[p2] > 0)
        ans += b[p1] + w[p2], p1++, p2++;
    while(b[p1] > 0)
        ans += b[p1], p1++;
    while(b[p1] + w[p2] > 0)
        ans += b[p1] + w[p2], p1++, p2++;
    printf("%lld", ans);
    __Made in China__
}

I wonder how to fix it. Thank u!

»
14 months ago, hide # |
Rev. 4  
Vote: I like it 0 Vote: I do not like it

I almost used 2-SAT to do D. Also,I didn't finish D in the contest.And is writting 105 lines normal for D?

UPD:I mean E.

UPD2:I meant I didn't finish writing the code for D.

UPD3:I mean E in UPD2.

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

This was honestly a great context. Loved E and F, even though I didn't manage to solve it yet.

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

I didn't make F and I made two incorrect submissions before making E. However, I think they're nice problems, especially problem E. I made it in a clever way using the Disjoint Set Union. I felt good about it :)

  • »
    »
    13 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hey could you give me some insights on how to use DSU here?

    • »
      »
      »
      13 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      In fact, I used weighted DSU. When you know the relationship between A and B and the relationship between C and D, and you then know the relationship between B and C, you also know the relationship between A and D at the same time, just as DSU merges sets. All you have to do is maintain the weights on the nodes. You can learn the specifics of this algorithm online. I'm not sure what this algorithm is called in your part of the world.

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

The Japanese statement says:

同じ頂点を $$$2$$$ 度以上通らないパス

I translated it by AI but it says(in Chinese):

不经过相同的顶点 $$$2$$$ 次以上

It means:

paths that do not pass through the same vertex more than twice

My english is poor,sorry.

And then I wrote this.

You can find it worong because this:

if(vis[nex]>=2) continue;

It's strange.

After the contest,I realized that the statement means:

paths that do not pass through the same vertex more than once

Why?

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

could anyone tell me why i'm WA on test 49? I don't know how to fix it

wrote #define int long long

»
14 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

This is my Submission for c No. problem. What is wrong to this solution any explain please.....

  • »
    »
    14 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    for(int i = 0 ;i<min(n, m);i++){
          //if(x==0)break;
          if(w[i]>-1 && b[i]>-1 && x>0){
              sumb+=w[i];
              x--;
          }
          if(b[i]<0 && (w[i]+b[i])>0)sumb+=(w[i]+b[i]);
    }
    

    $$$m \to \min(n, m)$$$

»
14 months ago, hide # |
Rev. 2  
Vote: I like it +17 Vote: I do not like it

I want to report user gpt_4o used AI to solve task E; please ban the user!

I say that because it's very different from his everyday code style, but very similar to AI. The name gpt_4o is a blatant use of AI technology to compete, and the user has used AI-generated code to compete in the context of participating in the rating many times. This seriously deters the experience of the other contestants, defeats the purpose of the competition, and is an insult to every thoughtful, down-to-earth information competitor. Each of us urgently hopes that the authorities can strengthen the control of such behavior and quickly ban these users, thank you.

我这么说是因为这与他日常的代码风格大相径庭,却和AI非常相似。gpt_4o这个名字简直就是明目张胆的使用AI技术进行比赛,并且该用户已经非常多次在参与等级评定的情况下使用AI生成的代码来参赛了。这严重影响了其他选手的参赛体验,违背了举办这项比赛的初衷,这也是对每个认真思考的,脚踏实地的信息竞赛选手的侮辱。我们每个人都迫切希望官方能加强对此类行为的管控,快速封禁这些用户,感谢。

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

Had thought of a $$$O(2^n.n^2)$$$ solution for problem D, but it gives WA for some test cases. Can someone help?

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i, a, b) for (int i = (a); i < (b); ++i)

constexpr ll INF = LLONG_MAX;

inline bool isBitSet(int num, int bitPos) {
    return ((num >> bitPos) & 1) != 0;
}

void solve() {
    int n, m; cin >> n >> m;
    vector<vector<ll>> adj(n, vector<ll>(n, INF));
    while (m--) {
        int a, b; ll w; 
        cin >> a >> b >> w;
        --a, --b;
        adj[a][b] = adj[b][a] = w;
    }
    vector<vector<ll>> pathXor(1 << n, vector<ll>(n, INF));
    pathXor[1][0] = 0;
    for (int path = 0; path < (1 << n); ++path) {
        for (int pathEnd = 0; pathEnd < n; ++pathEnd) {
            if (!isBitSet(path, pathEnd) || (pathXor[path][pathEnd] == INF)) 
                continue;
            for (int newDest = 0; newDest < n; ++newDest) {
                const ll weight = adj[pathEnd][newDest];
                if (isBitSet(path, newDest) || weight == INF) 
                    continue;
                const int newPath = path | (1 << newDest);
                pathXor[newPath][newDest] = min(pathXor[newPath][newDest], pathXor[path][pathEnd] ^ weight);
            }
        }
    }
    ll minPathXor = INF;
    for (int path = 0; path < (1 << n); ++path) {
        if (isBitSet(path, 0) && isBitSet(path, n - 1)) {
            minPathXor = min(minPathXor, pathXor[path][n - 1]);
        }
    }
    cout << minPathXor << "\n";
}

int main() {
    int T = 1;
    // cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}
»
14 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

https://atcoder.jp/contests/abc396/submissions/63519606 https://atcoder.jp/contests/abc396/submissions/63518496 https://atcoder.jp/contests/abc396/submissions/63530422 https://atcoder.jp/contests/abc396/submissions/63524401

The code above seems to be solved using an LLM (the code structures are very similar). If no action is taken, more people will start using LLMs in the competition. I hope necessary measures are taken.

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

G=663E :(

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

I hope to solve it by using graphical knowledge