QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#624763#5. 在线 O(1) 逆元BlackPandaCompile Error//C++14211b2024-10-09 16:35:192024-11-05 22:04:45

Judging History

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

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

answer

#include <inv.h>

int inv[100000001];

void init(int p)
{
	inv[1] = 1;
	for (int i = 2; i <= 100000000; i ++ )
	{
		inv[i] = (p - p / i) * inv[p % i] % p;
	}
}

int inv(int x)
{
	return inv[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:1:10: fatal error: inv.h: No such file or directory
    1 | #include <inv.h>
      |          ^~~~~~~
compilation terminated.