QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#749792#4900. 数列重排NineSuns0 19ms14972kbC++141.0kb2024-11-15 10:16:252024-11-15 10:16:25

Judging History

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

  • [2024-11-15 10:16:25]
  • 评测
  • 测评结果:0
  • 用时:19ms
  • 内存:14972kb
  • [2024-11-15 10:16:25]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define pii pair <int, int>
#define fi first
#define se second
#define pb push_back
#define int long long

using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1e7+5, inf = 0x3f3f3f3f3f3f3f3f, mod = 998244353; 
int m, l, r, x, pr[N], n;   
string str; 

int sum (int n) { return n*(n+1)/2; }
int gets (int k, int c) {
	if (c == 0 && k) return inf; 
	if (c == 0) return 0; 
	return sum(k/c)*(c-k%c)+sum(k/c+1)*(k%c); 
}

void solve () {
	cin >> m >> l >> r >> x >> str; 
	n = m*x; 
	for (int i = 0;i < m;i++) {
		n += str[i]-'0'; 
		pr[i] = str[i] == '1' ? (i ? pr[i-1]+1 : 1) : 0; 
	}
	ll res = 1; 
	for (int i = 1;i <= m;i++) res = res*233%mod; 
	ll ans = sum(n); 
	for (int i = 1;i < m;i++) ans -= n-i+1; 
	cout << ans*res%mod; 
}

signed main () {
//	ios::sync_with_stdio(0);
//	cin.tie(0); cout.tie(0);
	int T = 1; //cin >> T;
	while (T--) solve();
	return 0;
}
/*
3 0 3 3
101
*/

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3536kb

input:

2 0 2 2
01

output:

542890

result:

wrong answer 1st numbers differ - expected: '541257', found: '542890'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #14:

score: 0
Wrong Answer
time: 0ms
memory: 3504kb

input:

2 0 1 114514
10

output:

218508755

result:

wrong answer 1st numbers differ - expected: '934764137', found: '218508755'

Subtask #5:

score: 0
Wrong Answer

Test #17:

score: 0
Wrong Answer
time: 19ms
memory: 14972kb

input:

1000000 1000000 1000000 928
01100010010000000101111110001111011101111000011110100101011110011001001000011000110101101100111110000100101010111001111100010011100110000000111110110100001100000000011101100001010001010000010000001001000110011111010101111100001001110110010100000011000010010001111010011100...

output:

483549410

result:

wrong answer 1st numbers differ - expected: '437299311', found: '483549410'

Subtask #6:

score: 0
Wrong Answer

Test #19:

score: 0
Wrong Answer
time: 18ms
memory: 12124kb

input:

1000000 0 1000000 1
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

619753819

result:

wrong answer 1st numbers differ - expected: '852768823', found: '619753819'

Subtask #7:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 18ms
memory: 13728kb

input:

1000000 0 9823 627
01110001011101001100010011100101001011000011011110001101010000000101010111110111110010010001110100101001111000111100011101111001000000100111000010010100010101110110111110100010101010001110111001100011010001111000101010000110010010101110101010111110110001110111111000001110000110011...

output:

-401086122

result:

wrong answer 1st numbers differ - expected: '383638431', found: '-401086122'

Subtask #8:

score: 0
Skipped

Dependency #1:

0%

Subtask #9:

score: 0
Skipped

Dependency #1:

0%