Skip to content

Instantly share code, notes, and snippets.

View jeon3029's full-sized avatar
🏠
Working from home

jeon3029

🏠
Working from home
  • Republic of Korea, Seoul
View GitHub Profile
@jeon3029
jeon3029 / bits-stdc++.h
Created April 9, 2024 02:30 — forked from Einstrasse/bits-stdc++.h
bits/stdc++.h header file
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@jeon3029
jeon3029 / surjective.c
Created June 22, 2021 08:07 — forked from thinkphp/surjective.c
Generating the total number of surjective functions
#include <stdio.h>
#define SIZE 100
int stack[SIZE],
level,
N,
M;
void init() {
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
using namespace std;
vector<int> getPi(string p){
int m = (int)p.size(), j=0;
vector<int> pi(m, 0);
for(int i = 1; i< m ; i++){
while(j > 0 && p[i] != p[j])