Comments
On szilbCodeforces Round 1030 (Div. 2), 11 months ago
0

yup lost 2 submissions because of this, always use 1LL (':

On Cocoly1990Good Bye 2024: 2025 is NEAR, 17 months ago
0

I don't know why I could not realize this and should have just used 2*n. Hopefully next year, I start making actual progress (: . Thanks for your comment

On Cocoly1990Good Bye 2024: 2025 is NEAR, 17 months ago
0

Problem B:

//code for Problem B 
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const ll MOD = 1e9 + 7;

void solve(){
    ll n;
    cin >> n;
    ll left[n];
    ll right[n];
    ll arr[400001];
    map <ll,ll> m;
    for(ll i=0; i<400001; i++){
        arr[i] = 0;
    }
    for(ll i=0; i<n; i++){
        cin >> left[i] >> right[i];
        if(left[i] == right[i]){
            m[left[i]] += 1;
            arr[left[i]] = 1;
        }
    }
    
    ll prefix[400001];
    prefix[0] = 0;
    for(ll i=1; i<400001; i++){
        if(arr[i] == 0){
            prefix[i] = prefix[i-1]+1;
        }
        else{
            prefix[i] = prefix[i-1];
        }
    }
    for(ll i=0; i<n; i++){
        if(left[i] == right[i]){
            if(m[left[i]] > 1){
                cout << 0;
            }
            else{
                cout << 1;
            }
        }
        else{
            ll free = prefix[right[i]] - prefix[left[i]-1];
            if(free > 0){
                cout << 1;
            }
            else{
                cout << 0;
            }
        }
    }
    cout << endl;
    return;
}
 
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll tt;
    cin >> tt;
    while(tt--){
        solve();
    }
}

Can someone tell me WHY this was TLE'ing, I couldn't figure it out for the life of it and had probably my worst contest ever.

E in my opinion should be between 1400 and 1600. Couldn't really solve F so can't give my opinion on it.