QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#624691#5. 在线 O(1) 逆元dww_1337Compile Error//C++14231b2024-10-09 16:26:052024-11-05 22:04:36

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 22:04:36]
  • 管理员手动重测本题所有提交记录
  • [2024-10-09 16:26:07]
  • 评测
  • [2024-10-09 16:26:05]
  • 提交

answer

#include "inv.h"

const int MAXN = 1e8 + 7;
int invt[MAXN];

void init(int p)
{
	invt[1] = 1;
	for(int i = 1 ; i <= MAXN ; i++) invt[i] = (long long)(p - p / i) * invt[p % i] % p
}

int inv(int x)
{
	return invt[x];
}

详细

implementer.cpp: In function ‘int main()’:
implementer.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
answer.code: In function ‘void init(int)’:
answer.code:9:92: error: expected ‘;’ before ‘}’ token
    9 |         for(int i = 1 ; i <= MAXN ; i++) invt[i] = (long long)(p - p / i) * invt[p % i] % p
      |                                                                                            ^
      |                                                                                            ;
   10 | }
      | ~