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

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

We will hold AtCoder Regular Contest 134.

The point values will be 300-400-500-600-900-1000.

We are looking forward to your participation!

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

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

I don't know whether I'm happy there are no stupid meme comments under atcoder announcements, or upset that the contests aren't getting too much attention. Either way, I'm looking forward to being proven yet another time that I know nothing about problemsolving

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

I only received a reminder email about the upcoming ABC 237, but no reminder email about the upcoming ARC 134, which will happen earlier. I expect to receive the reminder for the contest that will be held earlier first.

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

Will AtCoder ever consider looking into making the times PST-friendly or varied?

P.S. Not demanding anything, just curious.

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

Starts in 5 minutes.

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

GG

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

When can we expect to see Cpp20 support for atcoder ?

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

In other words, in every box, the number of balls with 1 should be greater than that of the other balls.

How does this not mean "For all box, the number of ball $$$1$$$ is greater than the number of ball $$$i$$$, for all index $$$i \ge 2$$$"?

I wasted like 1 hour solving the wrong version :(

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

The problem E... I can't imagine the solution has an exponential complexity until i write it out.

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

Regarding task A). When a tarp covers the range [x, x+w], both ends included, then the tarp has length w+1, right? Am I stupid? Doesn't that make the answer ceil(l_i/(w+1)) for each segment?

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

I registered 5 minutes before the contest so that I forgot to check the author today.

As a result, I found that the problems are not my style and I got negative delta.

I have no idea about "(4,8) is a corner case".

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

How to solve problem C? I am not smart enough to understand the editorial.

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

Problem A I wonder where the mistakes are QwQ

#include<bits/stdc++.h>
#define int long long
//define LOCAL
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
using namespace std;
 
int N,L,W;
const int SIZE=1e5+7;
int a[SIZE];
 
signed main()
{
	#ifdef LOCAL
		freopen(".in","r",stdin);
		freopen(".in","w",stdout);
	#endif
	cin>>N>>L>>W;
	REP(i,N)cin>>a[i];
	sort(a,a+N);
	a[N]=L;
	//REP(i,N+1)cout<<a[i]<<" ";
	int cnt=0;
	REP(i,N)cnt+=ceil(max(0LL,(a[i+1]-a[i]-W))/(1.0*W));
	cnt+=ceil((a[0]-0)/(1.0*W));
	cout<<cnt<<endl;
	return 0;
	
}

`

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

    you need to set int to long long

    and also you have to cast w to long double while division

    here is the new AC code

    #include<bits/stdc++.h>
    #define int long long
    //define LOCAL
    #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
    #define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
    using namespace std;
     
    long long N,L,W;
    const int SIZE=1e5+7;
    long long a[SIZE];
     
    signed main()
    {
    	#ifdef LOCAL
    		freopen(".in","r",stdin);
    		freopen(".in","w",stdout);
    	#endif
    	cin>>N>>L>>W;
    	REP(i,N)cin>>a[i];
    	sort(a,a+N);
    	a[N]=L;
    	//REP(i,N+1)cout<<a[i]<<" ";
    	int cnt=0;
    	REP(i,N)cnt+=ceil(max(0LL,(a[i+1]-a[i]-W))/((long double)W));
    	cnt+=ceil((a[0]-0)/((long double)W));
    	cout<<cnt<<endl;
    	return 0;
    	
    }
    
»
4 года назад, скрыть # |
 
Проголосовать: нравится +34 Проголосовать: не нравится

The clarification did not popup? I saw it after the contest ended.

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

https://atcoder.jp/contests/arc134/submissions/28877523 plz see this wa on 3 test case in q2 i tried alot of tc but cant come up with AC solution if anyone can figure out tc or whats wrong plz tell

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

Can anyone identify what i am missing? WA*4, AC*91

int main(){

    FIO;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output2.txt", "w", stdout);
    #endif
    
    ll t;
    t = 1;
    //cin >> t;
    
while(t--){
    
    ll n;
    cin >> n;
    
    vector<ll> a(n);
    vector<ll> b(n);
    
    for(ll i=0; i<n; i++) cin >> a[i];
    for(ll i=0; i<n; i++) cin >> b[i];
    
    vector<ll> smallestElement(n);
    smallestElement[n-1] = a[n-1];
    for(ll i=n-2; i>=0; i--){
        smallestElement[i] = min(smallestElement[i+1], a[i]);
    }
   
    vector<ll> ans1;
    vector<ll> ans2;
    ll sid = 0;
    for(ll i=1; i<n; i++){
        if(a[i] < a[sid]){
            sid = i;
        }else if(a[i] == a[sid] && b[i]<b[sid]){
            sid = i;
        }
    }
   // cout << a.size() << " " << b.size() << endl;
   
    if(a[sid] >= b[sid]){
        cout << a[sid] << " " << b[sid] << endl;
        continue;
    }
    
    //cout << a.size() << " " << b.size() << endl;
    for(ll i=0; i<n; i++){
        if(a[i] == smallestElement[i] && (ans2.size() == 0 || a[i] < ans2[0])){
            ans1.pb(a[i]);
            ans2.pb(b[i]);
        }    
    }
    
    
    for(ll i=0; i<ans1.size(); i++)
        cout << ans1[i] <<" ";
    for(ll i=0; i<ans2.size(); i++)
        cout << ans2[i] << " ";
    
    cout << endl;
    
}
}

~~~~~ Your code here...

~~~~~

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

Regarding the last sentence of editorial for F,

"explicit" formula