| TypeCast/threepwood | TypeCast/Dstamplevskiy1 | ||||
|---|---|---|---|---|---|
| f | 1 | import sys | f | 1 | import sys |
| 2 | from functools import wraps | 2 | from functools import wraps | ||
| 3 | 3 | ||||
| 4 | 4 | ||||
| t | 5 | def cast(type): | t | 5 | def cast(typ): |
| 6 | def gen_cast(f): | 6 | def wrapper(fun): | ||
| 7 | @wraps(f) | 7 | @wraps(fun) | ||
| 8 | def new_f(*args, **kwargs): | 8 | def func(*args, **kwargs): | ||
| 9 | return type(f(*args, **kwargs)) | 9 | return typ(fun(*args, **kwargs)) | ||
| 10 | return new_f | 10 | return func | ||
| 11 | return gen_cast | 11 | return wrapper | ||
| 12 | 12 | ||||
| 13 | 13 | ||||
| 14 | exec(sys.stdin.read(), globals()) | 14 | exec(sys.stdin.read(), globals()) | ||
| 15 | 15 | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||