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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
void getFromtxt(char *name, vector<int>&nums) | |
{ | |
ifstream input; | |
input.open(name);//read from a txt file |
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<cstdio> | |
int main() | |
{ | |
int a[5]={1,2,3,4,5}; | |
printf("sizeof(&a):%d\tsizeof(a)%d\n",sizeof(&a),sizeof(a)); | |
int *ptr=(int *)(&a+1); | |
printf("a=%d,&a=%d,a+1=%d,&a+1=%d\n",a,&a,a+1,&a+1); | |
printf("%d,%d",*(a+1),*(ptr-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
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <time.h> | |
using namespace std; |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <ctime> | |
#include <utility> |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <time.h> | |
#include <set> |
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 <iostream> | |
#include <vector> | |
#include <vcg/complex/complex.h> | |
#include <wrap/io_trimesh/import.h> | |
#include <wrap/io_trimesh/export.h> | |
using namespace std; | |
// Forward declarations needed for creating the used types | |
class CVertexO; |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
inline void redirect(void) | |
{ | |
#ifdef DEBUG | |
freopen("input.txt","r",stdin); | |
freopen("output.txt","w",stdout); |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
/* | |
combination for get m from num of numbers | |
*/ | |
class combination | |
{ | |
public: |
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 BITSPERWORD sizeof(int)*8 | |
#define SHIFT 5 | |
#define MASK 0x1f | |
#define N 10000000 | |
int a[1+N/BITSPERWORD]; | |
void set(int i){ | |
a[i/BITSPERWORD]|=(1<<(i%BITSPERWORD)); | |
} |
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 <iostream> | |
#include <queue> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <cmath> | |
#include <ctime> | |
#include <cstdio> | |
#include <cstring> |