QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864644#9680. 数字变换KaXdd_#6 1427ms27084kbC++142.5kb2025-01-20 20:54:222025-01-20 20:54:22

Judging History

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

  • [2025-01-20 20:54:22]
  • 评测
  • 测评结果:6
  • 用时:1427ms
  • 内存:27084kb
  • [2025-01-20 20:54:22]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define rg register
#define il inline
#define TT(T, Args) template<typename T, typename... Args>
#define L(i, a, b) for (rg int i = (a); i <= (b); i++)
#define R(i, a, b) for (rg int i = (a); i >= (b); i--)
#define rep(i, a) for (rg auto i : a)
using namespace std;
namespace xmpl_{
	il int rd(){
		int f = 1, x = 0;
		char ch = getchar();
		while(ch < '0' || ch > '9'){
			if (ch == '-') f = -1;
			ch = getchar();
		}
		while(ch >= '0' && ch <= '9'){
			x = x * 10 + ch - '0';
			ch = getchar();
		}
		return x * f;
	}
	TT(T, Args) il void rd(T &x){
		int f = 1;
		x = 0;
		char ch = getchar();
		while(ch < '0' || ch > '9'){
			if (ch == '-') f = -1;
			ch = getchar();
		}
		while(ch >= '0' && ch <= '9'){
			x = x * 10 + ch - '0';
			ch = getchar();
		}
		x *= f;
	}
	TT(T, Args) il void rd(T &x, Args &...args){rd(x), rd(args...);}
	TT(T, Args) il void rdArr(T *arr, int cnt){while(cnt--) rd(*arr), arr++;}
	il void wt(int x){
		if (x < 0){
			putchar('-');
			x = -x;
		}
		if (x > 9) wt(x / 10);
		putchar(x % 10 + 48);
	}
	il void wtln(int x){wt(x), putchar('\n');}
	il void wtsp(int x){wt(x), putchar(' ');}
	il void swap(int &x, int &y){x ^= y ^= x ^= y;}
	il int max(int x, int y){return (x > y ? x : y);}
	il int min(int x, int y){return (x < y ? x : y);}
	il void ckmax(int &x, int y){x = max(x, y);}
	il void ckmin(int &x, int y){x = min(x, y);}
	il void cksum(int &x, int y){x += y;}
	TT(T, Args) il void ckmax(T &x, T y, Args &...args){ckmax(x, y), ckmax(x, args...);}
	TT(T, Args) il void ckmin(T &x, T y, Args &...args){ckmin(x, y), ckmin(x, args...);}
	TT(T, Args) il void cksum(T &x, T y, Args &...args){cksum(x, y), cksum(x, args...);}
}
using namespace xmpl_;
using namespace std;

const int N = 1e6 + 5, M = 21, p = 998244353, inf = 0x3f3f3f3f3f3f3f3f;
int l, r, n, f[N], g[N], ans[N];

il void init(){

}

il void clear(){
	
}

il void work(){
	rd(l, r, n), f[1] = ans[1] = 1;
	L(i, 1, n){
		L(j, 1, N - 5) g[j] = (f[j - 1] + f[j + 1]) % p;
		L(j, 1, (N - 5) / 2) L(k, j * 2, N - 5) g[k] = (g[k] + f[j]) % p, k += j - 1;
		L(j, 1, N - 5) f[j] = g[j], ans[j] = (ans[j] + f[j]) % p;
	}
	L(i, l, r) wtsp(ans[i]);
}

signed main(){
	// #define file 114514
#ifdef file	
	freopen("code.in", "r", stdin);
	freopen("code.out", "w", stdout);
#endif
	// init();
	int t = 1;
	// t = rd();
	while(t--){
		// clear();
		work();
		// puts("");
	}
	return 0;
}

詳細信息

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 107ms
memory: 27080kb

input:

1 10 3

output:

4 10 11 13 14 16 15 18 19 16 

result:

ok 10 numbers

Test #2:

score: 6
Accepted
time: 354ms
memory: 27084kb

input:

1 10 10

output:

1446 3555 5399 8364 9365 13867 13268 18455 18559 22035 

result:

ok 10 numbers

Test #3:

score: 6
Accepted
time: 37ms
memory: 27084kb

input:

1 10 1

output:

1 2 1 1 1 1 1 1 1 1 

result:

ok 10 numbers

Test #4:

score: 6
Accepted
time: 357ms
memory: 26920kb

input:

4 9 10

output:

8364 9365 13867 13268 18455 18559 

result:

ok 6 numbers

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #5:

score: 0
Wrong Answer
time: 1427ms
memory: 27084kb

input:

970000 1000000 40

output:

503190413 403501814 423543367 667735332 309717676 941521375 469059575 651585751 638081530 319769570 829344038 710448046 491906657 837995934 191992080 435477208 965318020 224310119 82608430 311469551 397529653 845900371 993051834 218739898 720518121 555742487 850145833 86074414 994934100 233037792 83...

result:

wrong answer 29963rd numbers differ - expected: '223031644', found: '223031643'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Runtime Error

Test #11:

score: 0
Runtime Error

input:

3000000000 3000000000 4

output:


result:


Subtask #5:

score: 0
Skipped

Dependency #3:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%