atcoder_official's blog

By atcoder_official, history, 3 weeks ago, In English

We will hold Sky Inc, Programming Contest 2026 (AtCoder Beginner Contest 455).

We are looking forward to your participation!

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

»
3 weeks ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

@ding870 @tangtianyao0123 ovo

  • »
    »
    4 hours ago, hide # ^ |
     
    Vote: I like it -7 Vote: I do not like it

    You will AK ABC.

    %%%%%%%%%

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hope I can solve DE.

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hell!I was ill!But hope I can solve EF(in this awful way)

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can you solve E

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

There are N cards and N piles of cards.

in question D, it should be Q piles of cards

»
3 weeks ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

It is hard for me to belive that 1k+ solved F. It didn't feel that easy to me.

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Felt like D was in my hand, but it slipped through a hole

»
3 weeks ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Easy A-F, Truly Hard G

»
3 weeks ago, hide # |
Rev. 3  
Vote: I like it +1 Vote: I do not like it

Speed really matters. Those who solve A-F got rank 10 to rank 1040.

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve D ?

»
3 weeks ago, hide # |
Rev. 7  
Vote: I like it +2 Vote: I do not like it

I solved G problem first part with a datastructure based solution. (non random)
Submission: https://atcoder.jp/contests/abc455/submissions/75273702

1st Subproblem:
  • Count the number of beautiful sequences in which all elements have frequency = V
  • So we can iterate on L pointer, from backside,(i.e) N to 1. and maintain all bad intervals for R pointers.
  • Bad R pointers for a element a[i] = [first occurence , V th occurence) + [(V+1) th occurence , N]
  • So this could be visualized as , for every new L pointer, we remove atmost 2 and add atmost 2 bad intervals.
  • Now the problem boils down to, interval addition and removal, and finding points covered by no intervals. (good R pointers)
  • This can be solved by LazySegTree, maintain (minimum , frequency of minimum) values in segment tree node, and perform range addition.
  • The frequency of 0, in Segment tree, would give me the number of good R pointers on iterating for each L pointer.
  • Idea: https://mirror.codeforces.com/blog/entry/137300
»
3 weeks ago, hide # |
Rev. 4  
Vote: I like it 0 Vote: I do not like it

how's my code wrong at C? can somebody help me pls

#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
int main(){
	int n,k;
	cin>>n>>k;
	vector<int>a(n);
	int cols=0;
	long long sum=0; 
	vector<pair<long long,int> >p;
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
		if(mp[a[i]]==0){
			cols++;
			p.push_back(make_pair(0,a[i]));
		}
		mp[a[i]]++;
	}
	for(int i=0;i<cols;i++){
		p[i].first=(long long)mp[p[i].second]*p[i].second;
	}
	sort(p.rbegin(),p.rend());
	for(int i=0;i<min(k,(int)p.size());i++){
		sum-=p[i].first;
	}
	cout<<sum<<endl;
	return 0;
}

  • »
    »
    3 weeks ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    You logic is correct. Also I am getting AC for your solution in C++23 (GCC 15.2.0). My atcoder profile is same as my CF user ID you see here. You can crosscheck my submission with your code.

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

      Thank you verrrrrrrrrrrry much! By the way, there's a contest called "Next dp contest" on Atcoder, which will be held on May 5th 12:00(but contest introduction says it's on 13:00) UTC+8 and lasts for 5 hours. Would you like to participate too? It's unrated though.