Skip to content

Instantly share code, notes, and snippets.

View rabiulcste's full-sized avatar

Rabiul Awal rabiulcste

View GitHub Profile
@rabiulcste
rabiulcste / Basic Template and Headers.cpp
Created January 7, 2016 15:37
Competitive Programming - Problem Solving Basic Codings
#include <bits//stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
vector<char> vc;
char s1[1005] , s2[1005];
int dp[105][105];
void backtrace(int i, int j)
{
if(i == 0 || j == 0)
return;
else if(s1[i-1] == s2[j-1]) {
backtrace(i-1, j-1);
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Importing necessary libraries
import numpy as np
import pandas as pd
import os
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <bits//stdc++.h>
using namespace std;
int a[10000];
int m, n, x, temp, sum, i, j;
int main()
{
while(scanf("%d", &n)==1){
a[0] = 1;
int main()
{
int n;
scanf("%d", &n);
map<string, int>mp;
for(int i=0; i<n; i++){
string s;
cin>>s;
if(mp[s] == 0) {mp[s]++; printf("OK\n");}
else {
#define MAX 1000001
char prime[MAX]; // 0 দিয়ে initialize করতে হবে
void seive( int n ) // n পর্যন্ত প্রাইম বের করব
{
int x = sqrt( n );
prime[0] = prime[1] = 1; // 0 এবং 1 প্রাইম না
for( int i = 4; i <= n; i += 2 ) // জোড় সংখ্যাগুলোকে বাদ দিয়ে দিব
prime[i] = 1;
bool isPrime(int n) {
if(n < 2) return false;
for(int i = 2; i < sqrt(n); i++)
if(n%i == 0) return false;
}
ll totient (ll i)
{
ll res; /* Result */
ll j;
if (i==1) return 1;
res=i;
// Check for divisibility by every prime number below the square root.