| TypeCast/BarabanovNS | TypeCast/AndrewBabichev | ||||
|---|---|---|---|---|---|
| f | 1 | from functools import wraps | f | 1 | from functools import wraps |
| 2 | import sys | 2 | import sys | ||
| 3 | 3 | ||||
| 4 | 4 | ||||
| t | 5 | def cast(converttype): | t | 5 | def cast(dtype): |
| 6 | def convertdecorator(fun): | 6 | def decorator(function): | ||
| 7 | @wraps(fun) | 7 | @wraps(function) | ||
| 8 | def newfun(*args, **kwargs): | 8 | def wrapper(*args, **kwargs): | ||
| 9 | return converttype(fun(*args, **kwargs)) | 9 | return dtype(function(*args, **kwargs)) | ||
| 10 | return newfun | 10 | return wrapper | ||
| 11 | return convertdecorator | 11 | return decorator | ||
| 12 | 12 | ||||
| 13 | 13 | ||||
| 14 | exec(sys.stdin.read()) | 14 | exec(sys.stdin.read()) | ||
| 15 | 15 | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||