This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isPrime(int n) { | |
if(n < 2) return false; | |
for(int i = 2; i < sqrt(n); i++) | |
if(n%i == 0) return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
NewerOlder