Финальные раунды Codeforces Blitz Cup 2025 стартовали! Присоединяйтесь к стриму: https://youtu.be/rbHFLNg7Nkc. ×

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

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

We will hold AtCoder Beginner Contest 396.

We are looking forward to your participation!

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

»
2 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
34 часа назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I am looking forward to it!!!

»
30 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Let's go

»
30 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Best of Luck everyone

»
30 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I am a Chinese. And you?

»
28 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I am looking forward to it!

»
28 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

man , what is wrong to this solution of C ?

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
    ll n, m; 
    cin >> n >> m;

    vector<ll> b(n), w(m);  

    for (ll i = 0; i < n; i++) cin >> b[i];
    for (ll i = 0; i < m; i++) cin >> w[i];

    ll ans = 0;
    sort(b.rbegin(), b.rend());
    sort(w.rbegin(), w.rend()); 

    ll contB = 0, parada = 0;
    
    for (ll i = 0; i < n; i++) {
        if (b[i] > 0) {
            ans += b[i];
            contB++;
        } else {
            parada = i;
            break;
        }
    }

    for (ll i = 0; i < min(contB, m); i++) { 
        if (w[i] > 0) {
            ans += w[i];
        } else {
            break;
        }
    }

    for (ll i = parada; i < min(n, m); i++) { 
        if (i < n && i < m && b[i] + ans + w[i] > ans) {
            ans += b[i] + w[i];
        } else {
            break;
        }
    }

    cout << ans << endl;
}

  • »
    »
    27 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You are adding repeated values to ans in the last loop, each value should be counted once.

    Hint
»
28 часов назад, # |
  Проголосовать: нравится +67 Проголосовать: не нравится

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.

  • »
    »
    28 часов назад, # ^ |
      Проголосовать: нравится +16 Проголосовать: не нравится
    • »
      »
      »
      28 часов назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      How do you explain people completely changing their coding style (templates, spacing etc.) when solving E, F, G?

  • »
    »
    27 часов назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    yeah. I totally agree with you. So many people use AI to solve problems in online competitions.

    It's an insult to the fairness. I think the user above should be banned as the poster said.

    We should take action to protect our contests from those methods that could create unfair competition, such as the use of AI.

    If left alone, why doesn't everyone use AI?

»
28 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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!

  • »
    »
    28 часов назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    this is my solution,I think it will help you.

    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    ll b[200050];
    ll w[200050];
    bool cmp(ll x,ll y)
    {
    	return x>y;
    }
    void solve()
    {
    	ll n,m;
    	cin>>n>>m;
    	for(ll i=1;i<=n;i++)
    	{
    		cin>>b[i];
    	}
    	for(ll i=1;i<=m;i++)
    	{
    		cin>>w[i];
    	}
    	sort(b+1,b+n+1,cmp);
    	sort(w+1,w+m+1,cmp);
    	ll ans=0;
    	for(ll i=1;i<=n;i++)
    	{
    		if(b[i]>=0&&w[i]>=0)
    		{
    			ans+=b[i]+w[i];
    		}
    		else if(b[i]>=0&&w[i]<0)
    		{
    			for(ll j=i;j<=n;j++)
    			{
    				if(b[j]>=0)
    				{
    					ans+=b[j];
    				}
    			}
    			break;
    		}
    		else if(w[i]+b[i]>0)
    		{
    			ans+=w[i]+b[i];
    		}
    	}
    	cout<<max(0ll,ans);
    }
    int main()
    {
    	ios::sync_with_stdio(false);
    	cin.tie(0);
    	ll _=1;
    	//cin>>_;
    	while(_--)
    	{
    		solve();
    	}
    	return 0;
    }
    
    
  • »
    »
    28 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I think the third while loop should come before second, because first if both of them are positive then we take both, if w[p2] < 0 we ignore, but if w[p2] > 0, we must take 1 black ball with it so we need to check w[p2]+b[p1] > 0 and at last if there are any positive value black balls left, then we can take those

»
28 часов назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
28 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
27 часов назад, # |
  Проголосовать: нравится -12 Проголосовать: не нравится

Have nothing to do with F ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT ATCODER YOU ARE SO BAD YOU ABANDONED ME TAT

»
27 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 :)

»
27 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I think D is much easier than before...

»
27 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
27 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

wrote #define int long long

»
27 часов назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Another AI Beat Contest.

»
26 часов назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    24 часа назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
    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)$$$

»
25 часов назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

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生成的代码来参赛了。这严重影响了其他选手的参赛体验,违背了举办这项比赛的初衷,这也是对每个认真思考的,脚踏实地的信息竞赛选手的侮辱。我们每个人都迫切希望官方能加强对此类行为的管控,快速封禁这些用户,感谢。

»
21 час назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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;
}
»
18 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
15 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I solved five problems!

»
14 часов назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

我不演了,我是中国的

»
10 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

G=663E :(