本题本来想用绷语言重写标程,结果发现我思路比标程简洁一些,就还是重写自己的程序了。
CF 737 C. (*1700)
C++
1 |
|
绷语言
1 | let ++ = x => y => (x + y) % M |
我还是计划使用 println
表示带换行的 print
。
语言设计解读
- 专用:
int
类型默认 64 位,对内存要求高时可自由切换位数。在 C++ 中则需要自己手动启用long long
或#define int long long
。 - 明确:利用高阶函数将需要改变定义的函数参数化,避免一切重载的同时不失便捷性。如果不想列出操作符,也可以选择将类型参数化。在 C++ 中则需要重载运算符。