Codeforces Round 953 (Div. 2) || Editorial for Problem A,B,C,D

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ย. 2024

ความคิดเห็น • 16

  • @UNKNOWN-tq4lq
    @UNKNOWN-tq4lq 4 หลายเดือนก่อน +2

    Came here after not getting the solution by tle eliminator, and became a subscriber, thank you 🎉

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +1

      you are welcome buddy, thanks ✌️🌟

  • @sabaokangan
    @sabaokangan 4 หลายเดือนก่อน +1

    You and @TLE_Eliminators are the only masters that can demystify Division 2 Codeforce Challenges for dummies like me ❤ from NYU 🗽

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +2

      glad to hear that ❤😊

  • @andresjvazquez
    @andresjvazquez 4 หลายเดือนก่อน +1

    Thank you much for diving into challenging Division 2s Sensei 🙇‍♂️

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +1

      its my pleasure to help you ❤

  • @nicspyy
    @nicspyy  4 หลายเดือนก่อน +2

    B solution:
    void solve(){

    int n,a,b;
    cin>>n>>a>>b;

    if(a >= b){
    cout

  • @grandparick3176
    @grandparick3176 4 หลายเดือนก่อน +1

    nicspy i like and appreciate that you make videos for us but I have only one complain which I guess others have made before and that is why don't you share your cf handle. If you do more people would appreciate and get to learn from you.

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +1

      we feel somehow under pressure to perform well, when we know somebody is going to stock our performance, hope you can understand, the reason, Why i did't share the ID, 😊

  • @akzytr
    @akzytr 4 หลายเดือนก่อน +1

    D was somehow easier than C, C was unusually hard for a C, D was unusually easy for a D.

    • @Entertainmentexe
      @Entertainmentexe 4 หลายเดือนก่อน +2

      I actually found C easier than usual. Most of the time I need the editorial to solve C. But this time I could solve it on my own.

    • @kshitiz6376
      @kshitiz6376 4 หลายเดือนก่อน +1

      This was probably the easiest C in CF div 2 history tbh

  • @divyanshuagarwal1912
    @divyanshuagarwal1912 4 หลายเดือนก่อน +1

    less complex code for D
    import java.util.Scanner;
    public class main {
    public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);
    int t = scn.nextInt();
    while (t-- > 0) {
    int n = scn.nextInt();
    long c = scn.nextLong(); // Changed to long
    long[] nums = new long[n]; // Changed to long
    long max = -1;
    int maxidx = -1;
    // Read the array and find the maximum value and its index
    for (int i = 0; i < n; i++) {
    nums[i] = scn.nextLong(); // Changed to nextLong()
    if (nums[i] > max) {
    max = nums[i];
    maxidx = i;
    }
    }
    // Calculate prefix sums
    long[] presum = new long[n]; // Changed to long
    presum[0] = nums[0];
    for (int i = 1; i < n; i++) {
    presum[i] = presum[i - 1] + nums[i];
    }
    // Calculate maximum suffix values
    long[] maxsuf = new long[n]; // Changed to long
    maxsuf[n - 1] = nums[n - 1];
    for (int i = n - 2; i >= 0; i--) {
    maxsuf[i] = Math.max(maxsuf[i + 1], nums[i]);
    }
    boolean damm = false;
    if (nums[0] + c < max) {
    damm = true;
    }
    for (int i = 0; i < n; i++) {
    if (i == maxidx && damm) {
    System.out.print(0 + " ");
    } else if (presum[i] + c >= maxsuf[i]) {
    System.out.print(i + " ");
    } else {
    System.out.print((i + 1) + " ");
    }
    }
    System.out.println();
    }
    }
    }

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +1

      thanks ❤️

  • @Iammuslim947
    @Iammuslim947 4 หลายเดือนก่อน +1

    Bro whats ur cf handle?

    • @nicspyy
      @nicspyy  4 หลายเดือนก่อน +1

      Let me check 😅