QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#629543#4096. 코딩 테스트Matutino0 860ms9664kbC++17896b2024-10-11 13:05:192024-10-11 13:05:20

Judging History

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

  • [2024-10-11 13:05:20]
  • 评测
  • 测评结果:0
  • 用时:860ms
  • 内存:9664kb
  • [2024-10-11 13:05:19]
  • 提交

answer

#include<bits/stdc++.h>
#define reg register
#define int long long
inline bool cmax(reg int &x,reg int y){return x<y?x=y,1:0;}
const int N=5e5+10,INF=1e18;
int n,a[N],b[N],pre[N];
#undef int
std::vector<int> testset(std::vector<int> A, std::vector<int> B, std::vector<int> L, std::vector<int> U){
	std::vector<int> res;
	#define int long long
	n=A.size(); for (reg int i=1;i<=n;i++) a[i]=A[i-1],i<n?b[i]=B[i-1]:0;
	for (reg int i=1;i<=n;i++) pre[i]=pre[i-1]+a[i]+b[i];
	for (reg int i=0;i<L.size();i++){
		reg int pl=0,pr=10,ans;
		auto check=[&](reg int x)->bool {
			for (reg int j=L[i]+1,mx=pre[j-1]-b[j-1]-(j-1)*x;j<=U[i]+1;j++){
				reg int now=pre[j]-j*x;
				if (mx>now) return 0; cmax(mx,now-b[j]);
			}
			return 1;
		};
		while (pl<=pr){
			reg int mid=pl+pr>>1;
			if (check(mid)) pl=mid+1,ans=mid; else pr=mid-1;
		}
		res.push_back(ans);
	}
	return res;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

2 1
746 733
619
0 1

output:

e4bc1609-b8fd-4286-b31c-e5e8e5765738
10

result:

wrong answer 2nd lines differ - expected: '1049', found: '10'

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 29ms
memory: 9564kb

input:

100000 100
19808256 24285218 35700559 40271678 34848402 69357487 68150704 33167327 11009744 51263605 95965914 99915162 98938894 25021047 41422333 21862896 68096319 74258633 12048507 49456137 34627666 2028097 39447833 88604280 58491153 12515029 84711345 70929241 88589416 4246292 47068575 45272978 203...

output:

e4bc1609-b8fd-4286-b31c-e5e8e5765738
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10...

result:

wrong answer 2nd lines differ - expected: '3433250', found: '10'

Subtask #3:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 860ms
memory: 9664kb

input:

5000 100000
93608251 16211038 93349835 94727166 27749929 28580474 39398397 58978075 32539760 49630110 14330110 62149976 63372420 45530888 44815920 40624609 4942456 35245376 9509556 17318048 91459277 83937735 82541206 16905922 22994630 56339982 33531160 45581398 67402358 51369287 2786263 53237145 830...

output:

e4bc1609-b8fd-4286-b31c-e5e8e5765738
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10...

result:

wrong answer 2nd lines differ - expected: '14700204', found: '10'

Subtask #4:

score: 0
Time Limit Exceeded

Test #51:

score: 0
Time Limit Exceeded

input:

100000 100000
8220608 27643636 9653375 7527483 4568995 4937547 27001430 10512886 14865249 54452685 31213146 1223559 25266797 9367382 5798933 1485258 33036920 2988776 5046089 41823731 6136379 20608943 10327625 90179994 75745370 21933251 3376845 19790905 52189711 21570452 18938610 18445540 26257950 24...

output:

Unauthorized output

result:


Subtask #5:

score: 0
Skipped

Dependency #1:

0%