Jaggu Playing with Balloons

Sort by

recency

|

9 Discussions

|

  • + 0 comments

    C++ Solution

    #include <bits/stdc++.h>
    
    using namespace std;
    
    #define rep(i, a, b) for(int i = a; i < b; i++)
    #define S(x) scanf("%d", &x)
    #define P(x) printf("%d\n", x)
    
    typedef long long int LL;
    
    int X[7] = {48576, 48640, 49152, 65536, 131072, 262144, 524288};
    const int MAXN = 1000001;
    LL BIT[MAXN];
    LL val;
    
    void update(int idx, int val){
        for(int i = idx; i < MAXN; i += i &-i) BIT[i] += val;
    }
    
    LL query(int idx){
        LL res = 0;
        for(int i = idx; i; i -= i & -i) res += BIT[i];
        return res;
    }
    
    void UUU(int pos, int M, int plus){
        rep(i, 0, 50) {
            int x = pos;
            int cnt = 999;
            while(x < MAXN){
                update(x, M);
                x += x & -x;
                if(x > MAXN && x != 1048576) {
                    x -= MAXN - 1;
                    cnt--;
                }
            }
            val += cnt * M;
            pos += plus;
            if(pos > 1000000) pos -= 1000000;
        }
    }
    
    int main(){
        int Q; S(Q);
        while(Q--){
            string s; cin >> s;
            if(s == "U"){
                int pos, M, plus;
                scanf("%d%d%d", &pos, &M, &plus);
                UUU(pos, M, plus);
            } else{
                int pos1, pos2;
                if(val) rep(i,0,7) update(X[i], val);
                scanf("%d%d", &pos1, &pos2);
                printf("%lld\n", query(pos2) - query(pos1 - 1));
                val = 0;
            }
        }
        return 0;
    }
    
  • + 1 comment

    Hey buddy, If you want to develop game like pubg then you need to know programming language. So you can learn that by just clicking here- Programming languages for game development. Thank you

  • + 1 comment

    What about using Business VPN while playing it? it would improve the skills.

  • + 1 comment

    cant understand what to do after this its not able to pass test cases other than test case0

    #include <cmath>
    #include<string.h>
    #include <cstdio>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    class Node{
        public:
        int data;
        int pos;
        Node* next;
    };
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */
        Node* start=new Node();
        start=NULL;   
        int Q;
        cin >> Q;
        char op;
        int pos, pos1, pos2, plus, M;
        while (Q--)
        {
            Node* n=new Node();
            cin >> op;
            if (op == 'U')      //Update
            {
                int sum=0;
                cin >> pos >> M >> plus;
                    int N=1000000;  //1 million
                    for (int i=1;i<=50;i++)
                    {
                        int back = pos;
                        for(int j=1;j<=1000;j++)
                        {
                            Node* p=new Node();
                            p->data=M;
                            p->pos=pos-1;
                            p->next=NULL;
                            if(start==NULL){
                                start=p;
                                n=p;
                            }
                            else{
                                n->next=p;
                                n=p;
                            }
                            int s,in=__builtin_popcount(pos);
                            for(int k=0;;k++)
                        {
                            s=pos+pow(2,k);
                            if( __builtin_popcount(s) <= in )
                            {
                                in = __builtin_popcount(s);
                                pos = s;
                                if(pos>N)       break;
                               Node* p=new Node();
                                p->data=M;
                                p->pos=pos-1;
                                p->next=NULL;
                                n->next=p;
                                n=p;
                            }
                        }
                        pos = pos - N;
                    }
                    pos = back+plus;
                    if(pos>N) pos-=N;
        }
    
               }
                else
                {
                    cin >> pos1 >> pos2;
                    long long x = 0;
                         Node* p=new Node();
                         p=start;
                         while(p->next!=NULL){
                             if(p->pos>pos1 && p->pos<pos2)
                                x += p->data;
                            p=p->next;
                         }
                    cout << x << endl;
                }
        }
         return 0;
    }
    
  • + 0 comments

    Developing games is not difficult. Anyone who is 10 years old can participate in GameMaker, read courses and develop games. It is difficult to become a professional in games. Creating a game that people pay for really requires skill, work and more happiness. I'm writer at MyAssignmentHelp UK Online Agency and I love to write about game development and I have written 1000+ articles related to popular games and development.