Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <map>
#include <deque>
#include <vector>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
#define LEN 1000003
@wowoto9772
wowoto9772 / 10244.cpp
Last active September 26, 2016 16:09
9월 개인과제(최승주)
#include <stdio.h>
int gcd(int a, int b){
int m = 1;
while(m){
m = a % b;
a = b;
b = m;

2번 이상 등장하는 부분 문자열 중 길이가 가장 긴 것의 길이 (hashing)

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) {

님 게임 (normal play rule)

마지막 돌을 가져가는 사람이 패배한다.

#include <stdio.h>
 
int main() {
 
    int n;
    scanf("%d", &n);
#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;
@wowoto9772
wowoto9772 / 1039.cpp
Last active October 17, 2016 05:52
10월 개인과제(최승주)
#include <cstdio>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
bool chk[1000003][13];
int value(string a){
#-*- 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(" ", " ")
#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){}
};
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
}
}
}