QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864578#9679. 盒子KaXdd_#0 21ms3584kbC++142.5kb2025-01-20 19:28:222025-01-20 19:28:22

Judging History

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

  • [2025-01-20 19:28:22]
  • 评测
  • 测评结果:0
  • 用时:21ms
  • 内存:3584kb
  • [2025-01-20 19:28: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, 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){
		ans = 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: 0ms
memory: 3456kb

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
6

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: 21ms
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:

5
6
4
14
9
4
9
14
4
4
7
11
9
5
12
14
10
15
5
6
5
12
12
5
4
10
6
4
7
5
6
5
5
13
5
10
4
5
11
13
6
6
15
16
4
8
15
15
6
5
6
6
10
6
4
11
9
9
6
6
8
5
12
6
6
5
5
8
4
10
10
10
6
4
5
5
8
7
6
14
6
11
13
4
4
11
15
8
4
8
5
5
6
10
9
14
4
4
9
11
7
7
6
16
11
16
12
4
5
5
8
5
12
14
7
17
14
9
6
11
8
15
12
6
6
10
11
1...

result:

wrong answer 2nd numbers differ - expected: '8', found: '6'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%