Skip to content

Instantly share code, notes, and snippets.

View atupal's full-sized avatar

kangle yu atupal

View GitHub Profile
/*
A. Greg and Array
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Greg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 ≤ li ≤ ri ≤ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by value di.
Greg wrote down k queries on a piece of paper. Each query has the following form: xi, yi, (1 ≤ xi ≤ yi ≤ m). That means that one should apply operations with numbers xi, xi + 1, ..., yi to the array.
<style type="text/css">
.linebr {
clear: both; /* 清除左右浮动 */
width: 100px; /* 必须定义宽度 */
word-break: break-word; /* 文本行的任意字内断开 */
@atupal
atupal / layout.html
Created April 8, 2013 17:08
two way to use mark down in python
first way:
{{ content }}
second way:
{% filter markdown %}
Your Markdown
=============
{% endfilter %}
//kmp失效函数
int* go(char *module)
{
int m = strlen(module);
int i;
int *p = (int *) malloc (sizeof(int) * m);
memset(p, 0, sizeof(p));
p[0] = -1;
int j = -1;
Nested X session
To run a nested session of another desktop environment:
/usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1
Virtual X session
To start another X session in, for example, Ctrl+Alt+F8, you need to type this on a console:
xinit /path/to/wm -- :1
挂载windos上的共享目录
#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import print_function
from argparse import ArgumentParser
import json
import re
import sys
try:
#Py3
import re
import json
import urllib
import base64
import hashlib
import requests
WBCLIENT = 'ssologin.js(v.1.3.18)'
sha1 = lambda x: hashlib.sha1(x).hexdigest()