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 <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#define CONCURRENT 10 |
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 <stdlib.h> | |
#include <sys/epoll.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> |
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 sys | |
import socket | |
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
sock.connect(("127.0.0.1",11111)) | |
s="0"+"1"*5000+"9" | |
while True: | |
#print len(s) | |
#sock.send(s) |
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
T=int(raw_input()) | |
t=0 | |
while t<T: | |
R,C,W=map(lambda x: int(x), raw_input().split()) | |
a=(C/W)*R+(W-1)+(1 if C%W>0 else 0) | |
t+=1 | |
print "Case #%d: %d"%(t,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
from math import * | |
T=int(raw_input()) | |
t=0 | |
while t<T: | |
K,L,S=map(lambda x:int(x),raw_input().split()) | |
k=raw_input() | |
l=raw_input() | |
n=0 |
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 bisect import bisect_left | |
def ins_d(n): | |
global d | |
if n>=d[-1]: | |
d+=[n]*C | |
else: | |
sep=bisect_left(d,n) | |
d=d[:sep]+[n]*C+d[sep:] |
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
T=int(raw_input()) | |
t=0 | |
while t<T: | |
C,D,V=map(lambda x:int(x),raw_input().split()) | |
d=sorted(map(lambda x:int(x),raw_input().split())) | |
a=0;n=1;s=0;pn=0 | |
while n<=V: | |
if n in d: |
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
def crosscheck(ri,ci,R,C,rect): | |
for cidx in range(ci+1,C): | |
if rect[ri][cidx] != '.': | |
return "COK" | |
for cidx in range(ci-1,-1,-1): | |
if rect[ri][cidx] != '.': | |
return "COK" | |
for ridx in range(ri+1,R): |
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
-module(demo). | |
-compile(export_all). | |
start(Bool, M) -> | |
A = spawn(fun()->a()end), | |
B = spawn(fun()->b(A,Bool)end), | |
C = spawn(fun()->c(B,M)end), | |
sleep(1000), | |
status(b,B), | |
status(c,C). |
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
def build_options(fields,x) | |
options = "" | |
fields.each do |field| | |
if x==0 | |
options += "-e '#{field}' " | |
else | |
options += "-e \"#{field}\" " | |
end | |
end | |
return options |
OlderNewer