Skip to content

Instantly share code, notes, and snippets.

import math
# One of the method for solving odes numerically
# Given a implicit function and x for initial x to marched to
def euler_method(implicit, x, y, marched, cleavage):
dx = (marched - x) / cleavage
for i in range(cleavage):
y = y + dx * implicit(x, y)
x += dx
return y
from math import log10, trunc
# x ** y 의 앞 맨 앞 자리수 m + 1 개를 구합니다.
# O(log(xlog(y))) 시간복잡도를 가지고 구할 수 있습니다.
def first(x, y, m=0):
lo = log10(x) * y
if lo < 0:
return 0
i = 1
j = pow(10, m+1)
from random import random
class Unreachable(Exception):
pass
def chain(elem, poss):
yield elem
yield from poss
# (x, p)
# -*- coding: UTF-8 -*-
from contextlib import contextmanager
import random
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase + ' '
radixPrime = 3
package main
import "fmt"
var T = map[string][2]int{
"black": [2]int{
0,
1,
},
"brown": [2]int{
nan = float('nan')
def anahash(s, bits):
h = 0
b = ~-(1 << bits)
for c in s:
shift = ord(c) * bits
i = b << shift
v = (h & i) >> shift
if v >= b:
# -*- coding: UTF-8 -*-
from math import trunc
import time
log10_2 = 0.3010299956639812
log10_digits = [
0.0,
0.3010299956639812,
# -*- coding: utf-8 -*-
ord_a = ord('a')
ord_z = ord('z')
ord_A = ord('A')
ord_Z = ord('Z')
nalpha = ord_z - ord_a + 1
def isalpha(char):
n = ord(char)

각 조의 주제와 더불어 나의 의견도 짧막하게 적어놓았음.

1 조
청소년 범죄 처벌 수위를 높여야 하는가

그렇다. 청소년이 판단 능력이 완전하지 못한 주체로 여기는 것은 현 시대와 괴리가 있는 생각이다. 따라서 판단 능력 부족으로 청소년 범죄에 약한 형벌을 가하는 것은 올바르지 않으며 청소년에게도 보다 엄격한 범의 잣대를 대어야 한다.

2 조

@ariesobj
ariesobj / palindrome.py
Created April 19, 2016 11:45
four method which checks if the string is a palindrome.
# 구현하기 귀찮음
from math import floor, ceil
# 정수 집합에서 정의된 자기 자신을 제외한 최소 하계
U = lambda x: floor(x + 1)
# 정수 집합에서 정의된 자기 자신을 제외한 최소 상계
L = lambda x: ceil(x - 1)
def impl1():