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 java.io.*; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
Reader reader = new Reader(); | |
Writer writer = new PrintWriter(new BufferedOutputStream(System.out)); | |
int N = reader.nextInt(); | |
for (int i=0; i<N; ++i) { | |
int a = reader.nextInt(), b = reader.nextInt(); |
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
func concatCopyPreAllocate(slices [][]byte) []byte { | |
var totalLen int | |
for _, s := range slices { | |
totalLen += len(s) | |
} | |
tmp := make([]byte, totalLen) | |
var i int | |
for _, s := range slices { | |
i += copy(tmp[i:], 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
#!/usr/bin/python | |
import logging | |
import socket | |
from threading import Thread | |
class PipeThread(Thread): | |
pipes = [] |