TypeCast/VoMaKu | TypeCast/Rizvan Zaidullin | ||||
---|---|---|---|---|---|
f | 1 | import sys | f | 1 | import sys |
2 | from functools import wraps | 2 | from functools import wraps | ||
3 | 3 | ||||
4 | 4 | ||||
n | 5 | def cast(cls): | n | 5 | def cast(typ): |
6 | def decorator(fun): | 6 | def decorator(fun): | ||
7 | @wraps(fun) | 7 | @wraps(fun) | ||
t | 8 | def function(*args): | t | 8 | def newfun(*args): |
9 | return cls(fun(*args)) | 9 | return typ(fun(*args)) | ||
10 | return function | 10 | return newfun | ||
11 | return decorator | 11 | return decorator | ||
12 | 12 | ||||
13 | 13 | ||||
14 | exec(sys.stdin.read(), globals()) | 14 | exec(sys.stdin.read(), globals()) | ||
15 | 15 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|