Giter VIP home page Giter VIP logo

programming-contest's Introduction

Programming Contest

Algorithm Implementation This folder contains all the codes of all the algorithms I generally use in the programming contests. Most of them are my implementation. But there are also few codes which I added or modified from the template library of forthright48 and Zobayer vaiya.

Code Repository This folder contains some well commented codes of some interesting problems I have solved. I learned something new solving most of these problems.

Template This folder contains the base template I normally use during coding. Also it contains some c++ template like big integer/fast io etc which we need sometimes during solving problems.

programming-contest's People

Contributors

flash7even avatar kimbbakar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

programming-contest's Issues

issue with solve() fucntion

int solve(int b){
num.clear();
while(b>0){
num.push_back(b%10);
b/=10;
}
reverse(num.begin(), num.end());
/// Stored all the digits of b in num for simplicity

memset(DP, -1, sizeof(DP));
int res = call(0, 0, 0);
cout<<res<<endl;
return res;

}

modified code for memset

int solve(int a,int b){
memset(dp,-1,sizeof(dp));
vector digitA;
getDigit(a-1,digitA);
int ans1=getData(digitA.size()-1,0,1,digitA);
vector digitB;
getDigit(b,digitB);
int ans2=getData(digitB.size()-1,0,1,digitB);
return ans2-ans1;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.