Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Shen WildfootW

  • National Taiwan University
  • Tainan Taiwan
View GitHub Profile
View bigN.cpp
#ifndef SUN_MOON_BIG_INT
#define SUN_MOON_BIG_INT
#define SM_BASE 1000000000
#define SM_BASE_DIGITS 9
/*SM_BASE 0 的個數為SM_BASE_DIGITS*/
#include<vector>
#include<iostream>
#include<iomanip>
#include<string>
#include<utility>/*for pair*/
View BFS
queue<int> q;
q.push (1);
while(! q.empty())
{
for(int j=0;j<q[i].size();j++)
{
if(!u[g[i][j]])
{
q.push(g[i][j]);
u[g[i][j]]=1;
@WildfootW
WildfootW / 1-sort.cpp
Created Aug 1, 2015
2015 C++ note by domen111
View 1-sort.cpp
//sort, reverse
#include <algorithm>
#include <cstdio>
using namespace std;
int cmp(int a,int b){
return a>b;//小於:由小而大 ,大於:由大而小
}