This file contains hidden or 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 <string.h> | |
#include <sys/time.h> | |
#include <pthread.h> | |
#include <assert.h> | |
#define CANDSIZE 1024 | |
// #define BUFSIZE 8 * 1024 * 1024 |
This file contains hidden or 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 <string.h> | |
void reverse_char_array(char * first, char * last) { | |
while (first != last && first != --last) { | |
*first ^= *last; | |
*last ^= *first; | |
*first++ ^= *last; | |
} | |
} | |
void reverse_string(char * sentence) { |
This file contains hidden or 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
n, m = map(int, raw_input().split()) | |
table = [map(int, list(raw_input())) for _ in xrange(n)] | |
weighted_table = [] | |
for r in table: | |
if sum(r) == 0: | |
print -1 | |
exit() | |
weighted_row = [] | |
for i in xrange(len(r)): | |
if r[i] == 1: |
This file contains hidden or 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 -*- | |
import Queue | |
import argparse | |
import os | |
import random | |
import subprocess | |
import sys | |
import threading | |
import time |
NewerOlder