Jim_X's blog

By Jim_X, 8 hours ago, In English

My template is below(for codeforces and practice usaco). If I can add anything new to it please tell me.

# MODULES TO CONSIDER
from collections import deque,defaultdict
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right
from string import ascii_letters,ascii_lowercase,ascii_uppercase,digits
from decimal import Decimal
from itertools import permutations,accumulate
from functools import cmp_to_key
from fractions import Fraction
from math import ceil,factorial
from copy import deepcopy
import sys# REMEMBER TO SET RECURSION LIMIT FOR DFS
            # DON'T USE DFS ON CODEFORCES EXCEPT IF YOU WANT MEMORY LIMIT EXCEEDED

# COMMON THINGS
# REMEMBER TO REMOVE THEM
map(int,input().split())
list(map(int,input().split()))
sorted(list(map(int,input().split())))
sorted(list(map(int,input().split())),reverse=True)
int(input())
input().strip()
input().split()
'        MAIN      FUNCTION        '
'__________________________________'
input=sys.stdin.readline
  • Vote: I like it
  • -7
  • Vote: I do not like it

»
8 hours ago, # |
  Vote: I like it +11 Vote: I do not like it

Templates aren't allowed on USACO, so for USACO, make one that is very easy to type that covers everything you need.

»
4 hours ago, # |
  Vote: I like it +2 Vote: I do not like it

Also I hope that you switch to c++(or some other faster language), since that can greatly benefit your long-term cp career.