QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864577#9679. 盒子KaXdd_#0 24ms3584kbC++142.5kb2025-01-20 19:27:382025-01-20 19:27:47

Judging History

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

  • [2025-01-20 19:27:47]
  • 评测
  • 测评结果:0
  • 用时:24ms
  • 内存:3584kb
  • [2025-01-20 19:27:38]
  • 提交

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, K = 2e6 + 5, inf = 0x3f3f3f3f3f3f3f3f;
int n, m, k, c, s, ans, a[N];

il void init(){

}

il void clear(){
	
}

il void work(){
	rd(n, m, k, c), rdArr(a + 1, n);
	if (c == 1){
		L(i, 1, n){
			ans += a[i] / k, a[i] %= k;
			if (a[i]){
				ans++;
				int nw = k;
				L(j, i, min(n, i + m - 1)){
					if (!nw) break;
					a[j] -= min(a[j], nw), nw -= min(a[j], nw);
				}
			}
		}
		wt(ans);
		return ;
	}
	cout << "MSYAKIOI";
}

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: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

3
5 2 4 3
2 2 1 2 2
4 2 4 3
2 4 1 1
10 3 5 1
2 2 2 2 1 1 1 10 2 2

output:

MSYAKIOI
MSYAKIOI
5

result:

wrong output format Expected integer, but "MSYAKIOI" found

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #35:

score: 0
Wrong Answer
time: 24ms
memory: 3584kb

input:

66664
7 2 82188055 1
35930054 4923258 36288509 46890418 53350617 49812938 68015568
10 2 460335201 1
305598063 240803174 36008172 416771728 391050572 270293987 333994588 436573185 216917970 103343453
9 3 119910901 1
35106715 29444257 72409421 49339248 23617992 3266647 38704192 75874356 72979434
10 1 ...

output:

4
9
12
25
33
36
44
57
60
63
69
79
87
91
102
115
124
138
142
147
151
162
173
177
180
189
194
197
203
207
212
216
220
232
236
245
248
252
262
274
279
284
298
313
316
323
337
351
356
360
365
370
379
384
387
397
405
413
418
423
430
434
445
450
455
459
463
470
473
482
491
500
505
508
512
516
523
529
534
...

result:

wrong answer 1st numbers differ - expected: '5', found: '4'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%