Комментарии
На MiracleMagician → Indian ICPC Prelims, 5 недель назад
+11

I mean its almost impossible if you think about it. Solving these many questions in 3 hrs with 1 PC.

На Jrke → Indian ICPC Camp 2026, 3 месяца назад
0

First Contest going to start in almost 1 hour Link for First Contest (6pm — 11pm) :

https://codeforces.me/group/wlb0UYQSQF/contest/710855 (Div 1)

https://codeforces.me/group/wlb0UYQSQF/contest/710866 (Div 2)

На Jrke → Indian ICPC Camp 2026, 3 месяца назад
+1

Majorly they will be in the evening only from 6-8. Rest will be updated on the whatsapp group

На Jrke → Indian ICPC Camp 2026, 3 месяца назад
0

We will be live on Youtube

На Jrke → Indian ICPC Camp 2026, 3 месяца назад
0

Orzz!

На Jrke → Indian ICPC Camp 2026, 3 месяца назад
+3

Yes

На shorya1835 → Indian ICPC Regionals, 2025 — 2026, 10 месяцев назад
+3

Just saw the AK prediction come true today haha XD.

contest is not opening from registered mail id

На Wansur → Разбор Codeforces Round 973 (Div. 2), 2 года назад
0
#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
// #include "..\debugging.h"
#endif

#define int long long
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using pi = pair<int, int>;
using vvi = vector<vector<int>>;
using vcb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using mi = map<int, int>;
using si = set<int>;


#define endl "\n"
#define all(x) begin(x), end(x)
#define sz(x) int((x).size())
#define fmap(name, x) mi name; for(auto it:x) ++name[it]
#define F first
#define S second
#define elif else if
#define PB emplace_back
#define MP make_pair
#define REPi(a, b) for (int i = a; i < b; i++)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define REPO(a) for (int i = 0; i < a; i++)
#define vvl(ab, r, c, v)  vvi ab(r, vector<int>(c, v))
#define dbg(v)  cout << #v << " = " << (v) << endl;

const long long mod = 1000000007ll, mod2 = 998244353ll;

int dist(vvi &tree, int p, int node, int p2 = -1) {
    int ans = 1;
    for(int c: tree[node])
        if(c != p && c != p2) {
            ans = max(ans, dist(tree, node, c )+1);
        }
    return ans;
}

void path(vvi &tree, int node, int target, int p, vi &ans) {
    for(int i: tree[node]) {
        if(i == p)
            continue;
        ans.PB(i);
        if(i == target) {
            return;
        }
        path(tree, i, target, node, ans);
        if(ans.back() != target)
            ans.pop_back();
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;

        vvi tree(n);
        for(int i=1; i<n; ++i) {
            int u, v;
            cin >> u >> v;
            --u, --v;
            tree[u].PB(v);
            tree[v].PB(u);
        }

        int u, v;
        cin >> u >> v;
        --u, --v;

        vi adist(n, 0), bdist(n, 0), p = {-1, 0};
        path(tree, 0, u, -1, p);
        p.PB(-1);

        int m = p.size()-2;
        vi dp(m);

        for(int i=1; i<m+1; ++i)
            dp[i-1] = dist(tree, p[i-1], p[i], p[i+1]);


        vi a(m), b(m);
        for(int i=m-1; i>=0; --i) {
            a[i] = dp[i] + i;
            b[i] = dp[i] + m-i-1;
        }

        vi suffdp(m, b.back());
        vi predp(m,a.front());
        for(int i =1 ;i<m-1;i++){
            predp[i] = max(a[i],predp[i-1]);
        }
        for(int i=m-2; i>=0; --i)
            suffdp[i] = max(suffdp[i+1], b[i]);

        // dbg(p);
        // dbg(a);
        // dbg(b);
        // dbg(dp);
        // dbg(suffdp);
        // dbg(predp);


        int start = 0, end = m-1;
        int counter = 1;
        while(start < end){
            if(counter && a[start] > suffdp[start+1] || !counter && b[end] > predp[end-1] ){
                counter = !counter;
                break;
            }
            if(counter)
                start++;
            else
                end--;

            counter = !counter;
        }

        if(start == end)
            counter = !counter;
        cout << (counter?"Bob" : "Alice") << endl;
    }

    return 0;
}

can someone explain why this is wrong for F1.

Basically I tried to find the path from 1 to u. For every path value I found Dp(max depth not on path)

then I checked for early exit. If this makes sense

0

what does this mean?

На duality → Codeforces Round #884 (Div. 1 + Div. 2), 3 года назад
+5

Is the round rated...... been waiting for the update since morning

На duality → Codeforces Round #884 (Div. 1 + Div. 2), 3 года назад
0

you can find the sum of all the positive number on odd indices and same should be done for even

we are then finding max of them and printing

in your case when all numbers are negetive suppose -1 -1 -2 5 -9

we know the ans should be 5

we know that the sum at odd indices is more now we will choose the number on odd indices that are negetive and remove them -> -3 5 -9 now we will remove -3 and -9

На n0sk1ll → Hello 2023, 4 года назад
-13

I got -2 because judge is not checking pretest 1 . Please help!! I got penaly because of printing unecessary things T_T