| TypeCast/Rizvan Zaidullin | TypeCast/VoMaKu | ||||
|---|---|---|---|---|---|
| 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(typ): | n | 5 | def cast(cls): |
| 6 | def decorator(fun): | 6 | def decorator(fun): | ||
| 7 | @wraps(fun) | 7 | @wraps(fun) | ||
| t | 8 | def newfun(*args): | t | 8 | def function(*args): |
| 9 | return typ(fun(*args)) | 9 | return cls(fun(*args)) | ||
| 10 | return newfun | 10 | return function | ||
| 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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||