| TypeCast/AndrewBabichev | TypeCast/BarabanovNS | ||||
|---|---|---|---|---|---|
| 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(dtype): | t | 5 | def cast(converttype): |
| 6 | def decorator(function): | 6 | def convertdecorator(fun): | ||
| 7 | @wraps(function) | 7 | @wraps(fun) | ||
| 8 | def wrapper(*args, **kwargs): | 8 | def newfun(*args, **kwargs): | ||
| 9 | return dtype(function(*args, **kwargs)) | 9 | return converttype(fun(*args, **kwargs)) | ||
| 10 | return wrapper | 10 | return newfun | ||
| 11 | return decorator | 11 | return convertdecorator | ||
| 12 | 12 | ||||
| 13 | 13 | ||||
| 14 | exec(sys.stdin.read()) | 14 | exec(sys.stdin.read()) | ||
| 15 | 15 | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||