Skip to content

Instantly share code, notes, and snippets.

View atikhashmee's full-sized avatar
🎰
Focusing

Atik Bin Hashmee atikhashmee

🎰
Focusing
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
long long toint(string s)
{
int ret=0;
for(int i=0; s[i]!='\0'; i++)
{
ret = ret*10+(s[i]-'0');
}
@atikhashmee
atikhashmee / uva100.cpp
Last active March 4, 2017 15:37
3n+1 problem solution .. don't copy it . try to understand the problem and solution .
#include <bits/stdc++.h>
using namespace std;
bool oddeven(int n)
{
if(n%2==0)
return true;
else
return false;
}
int uvaalgo( int n)
@atikhashmee
atikhashmee / Subeenoddeven.c
Created March 21, 2017 13:51
Practice : subeen book practise (accepted solution)
#include <stdio.h>
#include <string.h>
long long int toint(char a[])
{
long long ret=0;
int i;
int siz= strlen(a);
for( i=0; i<siz; i++)
{
ret = ret*10+(a[i]-'0');
@atikhashmee
atikhashmee / reverseandadd.cpp
Created March 22, 2017 06:54
10018 - Reverse and Add (accepted)
#include <bits/stdc++.h>
#define SI(a) cin>>a
#define PI(a) cout<<a<<endl
#define PIE(i,a) cout<<i<<" "<<a<<endl
#define ll long long
#define lli long long int
using namespace std;
lli reverse_number(lli n)
{
lli rev=0,reminder;
@atikhashmee
atikhashmee / 11727CostCutting.cpp
Created April 2, 2017 00:53
Cutting cost problem solution (accepted)
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tc,nu1,nu2,nu3,res,i=0;
cin>>tc;
while(tc--)
{
@atikhashmee
atikhashmee / 12751-An-Interesting-Game.cpp
Last active April 3, 2017 12:44
UVA 1251 (accepted)
/*********************************
*********************************
********************************
******************************
********************************
******************************
*/
#include <bits/stdc++.h>
/*the logic of this problem is to find out the distance between store and his car
so simply we will twice the difference of maximum value and minimum value
example . 7 30 41 14 39 42 max = 42 min= 7, difference is = 35
so the result is 35*2 =70
*/
#include <bits/stdc++.h>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
int a,b,temp;
ll sum=0,sum1=0;
cin>>a>>b;
if(a>b)
/*
bismillahir ragmanir rahim
hey allah give me strength and stamina to solve these problems
*/
#include <bits/stdc++.h>
using namespace std;
@atikhashmee
atikhashmee / ladders1(watermelon).cpp
Created September 11, 2017 12:14
see the editorial of codeforce to solve the problem
/*bismilla hir rahmanir rahim
starting from the name allah
*/
#include <bits/stdc++.h>
#define i int
using namespace std;
int main()