Skip to content

Instantly share code, notes, and snippets.

View tabvn's full-sized avatar

Toan tabvn

  • Danang, Vietnam
View GitHub Profile
@tabvn
tabvn / gomin.cpp
Last active October 25, 2018 14:31
#include <iostream>
#include <vector>
#include <fstream>
using namespace std;
ifstream fi ("/Users/toan/ued/GOMIN.INP");
ofstream fo ("/Users/toan/ued/GOMIN.OUT");
int timerIndex = -1;
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
/*
e^x = x^0/0! + x^1/1! + ... x^n/n!
*/
double chia(double x, double ep, int n){
#include <iostream>
using namespace std;
struct Time
{
int h,m,s;
};
Time t1,t2;
#include <iostream>
using namespace std;
struct Time
{
int h,m,s;
};
Time t1,t2;
#include <iostream>
#include <vector>
using namespace std;
/*
S = 1/0! + 1/1! + 1/2! + ... 1/n!
mau chung se bang n!
ta tinh theo kieu quy dong len roi gian uoc dan dan
*/
void displayCoupleOfNumber(int n){
int b = 0;
int tmp = sqrt(n);
int a = tmp;
while(true){
if(a<=0 || b >= tmp){
break;
}
if(a*a + b*b < n){
cout << "(" << a << ", "<< b<< ")" << endl;
@tabvn
tabvn / The Next Palindrome.cpp
Last active November 8, 2018 09:53
The Next Palindrome
#include <iostream>
#include <vector>
using namespace std;
vector<string> v;
int paseInt(char c) {
switch (c) {

LiveX Dashboard Local Development environment

Download

  • Checkout source code at bitbucket
git clone https://[email protected]/tabvn/livex_dashboard.git

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<long int> s;
vector<long int> p;
long int a[20000];
long long total = 0;
bool doiXung(string s, long long length){
if(length == 1){
return true;
}
bool dx = false;
long long i, j;
i = 0;
j = length - 1;
while(s[i] == s[j]){