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> | |
struct stack { | |
int v[100]; | |
int top; | |
} stacks[3]; | |
int N; | |
void push(struct stack * a, int v) { |
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
''' | |
c style python because of the consideration of efficiency, please use pypy3 instead of python3! | |
This is a replication of "Counting the Paths on a Grid" introduced in the paper "Coping with Finiteness" | |
(Donald E. Knuth, 1976). This program estimates the number of self-avoiding paths on a 10×10 grid, | |
starting from the point(0, 0) and ending at the point(10, 10). | |
~ pypy3 count_path_grid.py | |
1.5810562057001226e+24 |
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
import glob | |
from PyPDF2 import PdfFileMerger | |
def merger(output_path, input_paths): | |
pdf_merger = PdfFileMerger() | |
file_handles = [] | |
for path in input_paths: | |
pdf_merger.append(path) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
* ************************************************************************** | |
* Contributions to this work were made on behalf of the GÉANT project, | |
* a project that has received funding from the European Union’s Framework | |
* Programme 7 under Grant Agreements No. 238875 (GN3) | |
* and No. 605243 (GN3plus), Horizon 2020 research and innovation programme | |
* under Grant Agreements No. 691567 (GN4-1) and No. 731122 (GN4-2). | |
* On behalf of the aforementioned projects, GEANT Association is |
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
from collections import deque | |
class TrieNode: | |
def __init__(self, endWord = False, parent = None, char = ''): | |
# to record duplicate words | |
self.count = int(endWord) | |
self.children = dict() | |
# fail pointer of Aho Corasick Automaton | |
self.fail = None | |
# recording the parent in order to output the matched concept |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import random | |
import sys | |
import time | |
# sys.setrecursionlimit(10000) | |
def qsort(a): | |
if len(a) <= 1: return a | |
pivot = random.choice(a) | |
left = qsort([x for x in a if x < pivot]) |
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
/* | |
* Copyright (C) 2020-2021 Andi Zhang <[email protected]> | |
*/ | |
#include <iostream> | |
using namespace std; | |
class MyInt { | |
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
ai_service_enable = "false" | |
ai_service_mode = "0" | |
ai_service_pause = "false" | |
ai_service_source_lang = "0" | |
ai_service_target_lang = "0" | |
ai_service_url = "http://localhost:4404/" | |
all_users_control_menu = "true" | |
apply_cheats_after_load = "false" | |
apply_cheats_after_toggle = "false" | |
aspect_ratio_index = "0" |
OlderNewer