QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209291#5. 在线 O(1) 逆元fstqwq0 0ms0kbC++14295b2023-10-10 13:45:262024-11-05 21:53:02

Judging History

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

  • [2024-11-05 21:53:02]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-10-10 13:45:27]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-10-10 13:45:26]
  • 提交

answer

const int mod = 998244353;
const int pre = mod / 20;

int a[pre];

void init(int p) {
	a[0] = a[1] = 1;
	for (int i = 2; i < pre; i++) {
		a[i] = 1ll * (i - i / mod) * a[i % mod] % mod;
	}
}

int inv(int x) { return x < pre ? a[x] : int(1ll * (x - x / mod) * inv(x % mod) % mod); }

詳細信息


Pretests


Final Tests

Test #1:

score: 0
Memory Limit Exceeded

Test #2:

score: 0
Memory Limit Exceeded

Test #3:

score: 0
Memory Limit Exceeded

Test #4:

score: 0
Memory Limit Exceeded

Test #5:

score: 0
Memory Limit Exceeded