编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#5701 | #1058. 连加连乘 | Compile Error | 0 | 0 ms | 0 K | C++ 17 / 3.0 K | YueGuan1234 | 2024-08-17 14:32:16 |
using namespace std;
int
;
int MInt<0>::Mod = 1e9 + 7;
constexpr int P = 1e9 + 7;
using Z = MInt<P>;
void
signed
编译信息
/sandbox/1/a.cpp: In member function 'constexpr MInt<P>& MInt<P>::operator*=(MInt<P>) &':
/sandbox/1/a.cpp:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
/sandbox/1/a.cpp:35:29: note: in expansion of macro 'int'
35 | x = x * rhs.x % int(getMod());
| ^~~
/sandbox/1/a.cpp:35:28: error: expected ';' before 'long'
35 | x = x * rhs.x % int(getMod());
| ^
| ;
/sandbox/1/a.cpp:37:17: error: there are no arguments to 'mul' that depend on a template parameter, so a declaration of 'mul' must be available [-fpermissive]
37 | x = mul(x, rhs.x, getMod());
| ^~~
/sandbox/1/a.cpp:37:17: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/sandbox/1/a.cpp: In instantiation of 'constexpr MInt<P>& MInt<P>::operator*=(MInt<P>) & [with long long int P = 1000000007]':
/sandbox/1/a.cpp:90:18: required from here
/sandbox/1/a.cpp:37:20: error: 'mul' was not declared in this scope; did you mean 'fmul'?
37 | x = mul(x, rhs.x, getMod());
| ~~~^~~~~~~~~~~~~~~~~~~~
| fmul
/sandbox/1/a.cpp: In instantiation of 'constexpr MInt<P> MInt<P>::inv() const [with long long int P = 1000000007]':
/sandbox/1/a.cpp:48:69: required from 'constexpr MInt<P>& MInt<P>::operator/=(MInt<P>) & [with long long int P = 1000000007]'
/sandbox/1/a.cpp:66:9: required from 'constexpr MInt<1000000007> operator/(MInt<1000000007>, MInt<1000000007>)'
/sandbox/1/a.cpp:94:53: required from here
/sandbox/1/a.cpp:32:46: error: 'power' was not declared in this scope
32 | constexpr MInt inv() const { return power(*this, getMod() - 2); }
| ~~~~~^~~~~~~~~~~~~~~~~~~~~