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
| #coding=utf-8 | |
| import sys,os | |
| import re | |
| from collections import defaultdict,namedtuple | |
| from itertools import * | |
| def scc(edges,redges): | |
| def dfs(v): | |
| used.add(v) | |
| if v in edges: |
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
| 2 4 | |
| XXXX | |
| XOOO | |
| 4 4 | |
| XXXX | |
| OOOO | |
| XXXX | |
| OOOO |
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
| #coding=utf-8 | |
| import os | |
| import socket | |
| import select | |
| from time import sleep | |
| import binascii | |
| from subprocess import Popen,STDOUT,PIPE # Python 2.4以上が必要 | |
| import os | |
| from math import * |
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
| #coding=utf-8 | |
| import os | |
| import socket | |
| import select | |
| from time import sleep | |
| import binascii | |
| from subprocess import Popen,STDOUT,PIPE | |
| import os | |
| import math | |
| import itertools |
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
| #coding=utf-8 | |
| import os | |
| import socket | |
| import select | |
| from time import sleep | |
| import binascii | |
| from subprocess import Popen,STDOUT,PIPE | |
| import os | |
| from math import * | |
| import string |
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
| // 1-indexed | |
| template<class T> | |
| class BIT_2D { | |
| T bit[512 + 1][512 + 1]; | |
| int h, w; | |
| public: | |
| BIT_2D() {} | |
| BIT_2D(int H, int W) { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Windows.Forms; | |
| using System.Text; | |
| using System.IO; | |
| using System.Drawing; | |
| using System.Reflection; | |
| using System.Text.RegularExpressions; | |
| using System.Linq; | |
| using System.Net.Sockets; |
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
| #coding=utf-8 | |
| import os | |
| import socket | |
| import select | |
| from time import sleep | |
| import binascii | |
| class Client(object): | |
| def __init__(self): |
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
| import hashlib | |
| PRIME = 10162817389166932304743927803664677577393035849460315554227038992256439669168822924924642681859165915398841119695331997622323074382673543580118593098794075768017359068156207668418577358758037040886636583057751950491466568754968161402970164774854422196808968101372380404300325099055524339557705423721707 | |
| G = 1323857230486534278 | |
| def get_salt(m): | |
| for _ in range(1000): | |
| m = hashlib.sha512(m).hexdigest() | |
| return m |
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 <cstdio> | |
| #include <cassert> | |
| #include <vector> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef pair<int, int> Pii; | |
| #define FOR(i,n) for(int i = 0; i < (n); i++) |