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 <cstring> | |
using namespace std; | |
int buildlps (char * pat, int m, int *lps){ | |
lps[0] = lps[1] = 0; | |
for(int i=2; i<=m; i++){ | |
int j = lps[i-1]; | |
while(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> | |
using namespace std; | |
#define MOD 1000000007 | |
typedef unsigned long long ull; | |
ull dp[1001]; // with rep |
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 <cstdio> | |
typedef unsigned long long ull; | |
typedef unsigned u; | |
using namespace std; | |
const u INF=1<<31; | |
u f[105]; | |
char letter[105]; |
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 <cstdio> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
typedef unsigned long long ull; | |
const ull MOD = 1000000000ULL; | |
const int MH=15; | |
ull dp[MH+2][4096]; |
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 <cstring> | |
#include <cstdio> | |
#include <algorithm> | |
namespace IO{ | |
const int SIZE = 1 << 19; | |
char buff[SIZE], *p = buff + SIZE; | |
char read_char(){ | |
if( p == buff + SIZE ){ | |
fread( buff, 1, SIZE, stdin ); |
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 <cstring> | |
#include <cstdlib> | |
#include <cstdio> | |
using namespace std; | |
#define MAX 100012 | |
namespace IO{ | |
const int SIZE = 1 << 19; | |
char buff[SIZE], *p = buff + SIZE; |
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 <cstring> | |
#include <algorithm> | |
using namespace std; | |
typedef unsigned long long ull; | |
ull mod = 1000000007; | |
class _matrix{ | |
public: | |
ull x[2][2]; |
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 <cstring> | |
#include <vector> | |
using namespace std; | |
int v[205][205],N,M; | |
int dp[2][205][205]; | |
int init(){ | |
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 <cstring> | |
#include <cstdlib> | |
#include <cstdio> | |
#include <map> | |
#include <vector> | |
namespace IO{ | |
const int SIZE = 1 << 19; | |
char buff[SIZE], *p = buff + SIZE; | |
char read_char(){ |
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 <cstring> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
using namespace std; | |
#define PB push_back | |
typedef pair <int, bool> pii; | |
typedef unsigned long long ull; |
NewerOlder