QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#101593#5. 在线 O(1) 逆元NOI_AK_MECompile Error//C++20813b2023-04-30 13:55:022024-11-05 21:48:56

Judging History

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

  • [2024-11-05 21:48:56]
  • 管理员手动重测本题所有提交记录
  • [2024-11-05 21:44:37]
  • 管理员手动重测本题所有提交记录
  • 测评结果:Judging
  • 用时:0ms
  • 内存:0kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-30 13:55:05]
  • 评测
  • [2023-04-30 13:55:02]
  • 提交

answer

#pragma once
#pragma GCC optimize("Ofast, unroll-loops")
#include "inv.h"
int djq[3035136], arr[974849];
int inv(int x) {
	const int p = (unsigned long long) x * arr[x >> 10] % 998244353;
	return (unsigned long long) arr[x >> 10] * (p < 3035136 ? djq[p] : 998244353 - djq[998244353 - p]) % 998244353;
}
int getinv(int x) {
    return x == 1 ? 1 : 974849 - unsigned long long(974849 / x) * getinv(974849 % x) % 974849;
}
void init() {
	for(int i = 987;i;--i) {
		int inv = getinv(i);
		for(int j = 1;j <= 987;++j) {
			arr[(unsigned long long) j * inv % 974849] = i;
			arr[974849 - (unsigned long long) j * inv % 974849] = 998244353 - i;
		}
	}
	arr[0] = djq[1] = 1;
	for(int i = 2;i < 3035136;++i)
		djq[i] = 998244353 - unsigned long long(998244353 / i) * djq[998244353 % i] % 998244353;
}

详细

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:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
answer.code:2:43: warning: bad option ‘-f unroll-loops’ to pragma ‘optimize’ [-Wpragmas]
    2 | #pragma GCC optimize("Ofast, unroll-loops")
      |                                           ^
In file included from answer.code:3:
inv.h:1:16: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
    1 | void init(int p);
      |                ^
inv.h:1:16: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
inv.h:2:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
    2 | int inv(int n);
      |              ^
inv.h:2:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
answer.code:5:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
    5 | int inv(int x) {
      |              ^
answer.code:9:17: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
    9 | int getinv(int x) {
      |                 ^
answer.code: In function ‘int getinv(int)’:
answer.code:10:34: error: expected primary-expression before ‘unsigned’
   10 |     return x == 1 ? 1 : 974849 - unsigned long long(974849 / x) * getinv(974849 % x) % 974849;
      |                                  ^~~~~~~~
answer.code:10:33: error: expected ‘;’ before ‘unsigned’
   10 |     return x == 1 ? 1 : 974849 - unsigned long long(974849 / x) * getinv(974849 % x) % 974849;
      |                                 ^~~~~~~~~
      |                                 ;
answer.code:10:34: error: expected primary-expression before ‘unsigned’
   10 |     return x == 1 ? 1 : 974849 - unsigned long long(974849 / x) * getinv(974849 % x) % 974849;
      |                                  ^~~~~~~~
answer.code: At global scope:
answer.code:12:11: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes]
   12 | void init() {
      |           ^
answer.code: In function ‘void init()’:
answer.code:22:38: error: expected primary-expression before ‘unsigned’
   22 |                 djq[i] = 998244353 - unsigned long long(998244353 / i) * djq[998244353 % i] % 998244353;
      |                                      ^~~~~~~~