const int h[] = { 40007, 1000003, 500009 };
int pwmd[26][200005][3]; // (i ^ j) % h[k]
char str[200003];
int n;
set < pair <int, int> > hsh[40007];
bool possible(int len) {
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 <stdio.h> | |
#include <map> | |
#include <deque> | |
#include <vector> | |
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 <stdio.h> | |
#include <string.h> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
#define LEN 1000003 |
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 <stdio.h> | |
int gcd(int a, int b){ | |
int m = 1; | |
while(m){ | |
m = a % b; | |
a = b; | |
b = m; |
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> | |
#include <queue> | |
using namespace std; | |
struct ele { | |
int r, c, m; | |
ele() {} | |
ele(int _r, int _c, int _m) { | |
r = _r, c = _c, m = _m; |
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> | |
#include <string> | |
#include <queue> | |
#include <algorithm> | |
using namespace std; | |
bool chk[1000003][13]; | |
int value(string a){ |
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
#-*- coding: utf-8 -*- | |
def chooseIngredients(source): | |
# erase style tag | |
# \displaystyle, \scriptstyle | |
remv = ["\displaystyle", "\scriptstyle"] | |
for rem in remv: | |
source = source.replace(rem, "") | |
source = source.replace(" ", " ") |
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 <stdio.h> | |
#include <algorithm> | |
#define ll long long | |
using namespace std; | |
struct point{ | |
double x, y; | |
point(double x = 0, double y = 0) :x(x), y(y){} | |
}; |
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
for (int i = 2; i*i <= n; i++){ | |
if (!prime[i]){ | |
for (int j = i*i; j <= n; j += i){ | |
prime[j] = true; // prime[j] : false > j is prime | |
} | |
} | |
} |
OlderNewer