Codeforces Round 857 Div 2 | Problem A : Likes Solution | Explanation + Code | Hindi Editorial

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

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

  • @KaranMashru
    @KaranMashru ปีที่แล้ว

    (Subscribe for more such videos)
    Code :
    #include
    using namespace std;
    #define ll long long
    int main()
    {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll t, n, i, j, po, ne, score, p1, n1;

    cin>>t;

    for(;t--;)
    {
    po=ne=0;

    cin>>n;

    for(i=1; i>j;

    if(j>0){
    po++;
    }else{
    ne++;
    }
    }
    p1=po;
    n1=ne;
    score=0;

    for(i=1; i0){
    score++;
    po--;
    }else{
    score--;
    ne--;
    }

    cout

  • @novascotia2015
    @novascotia2015 ปีที่แล้ว

    question link please i dont know how to find from CF

  • @yearsago-bu7rw
    @yearsago-bu7rw ปีที่แล้ว

    can you tell why i am getting run time errror, thanks in advance.
    code:
    t = int(input())
    for _ in range(t):
    n = int(input())
    a = [int(x) for x in input().split()]
    po = 0
    ni = 0
    for x in a:
    if x > 0:
    po += 1
    else:
    ni += 1
    ma = [i for i in range(1, po+1)]
    for i in range(ni):
    ma.append(ma[-1] - 1)
    mi = []
    for i in range(min(po, ni)):
    mi.append(1)
    mi.append(0)
    for i in range(po - ni):
    mi.append(mi[-1] + 1)
    print(*ma)
    print(*mi)

    • @aneesbazmi1612
      @aneesbazmi1612 ปีที่แล้ว

      because you are not debugging clearly.

    • @yearsago-bu7rw
      @yearsago-bu7rw ปีที่แล้ว

      @@aneesbazmi1612 you found the bug?