QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#875193#2747. MeetingsAlimkhan#4 56ms3840kbC++23664b2025-01-29 12:34:052025-01-29 12:34:07

Judging History

This is the latest submission verdict.

  • [2025-01-29 12:34:07]
  • Judged
  • Verdict: 4
  • Time: 56ms
  • Memory: 3840kb
  • [2025-01-29 12:34:05]
  • Submitted

answer

#include "meetings.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int n, q;


std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) {
	n = H.size();
	q = L.size();
	vector <ll> c(q);
	for (int i = 0; i < q; i++) {
		ll mn = (ll)1e18 + 7;
		for (int j = L[i]; j <= R[i]; j++) {
			ll mx = H[j];
			ll sum = mx;
			for (int k = j + 1; k <= R[i]; k++) {
				mx = max(mx, H[k] * 1ll);
				sum += mx;
			}
			mx = H[j];
			for (int k = j - 1; k >= L[i]; k--) {
				mx = max(mx, H[k] * 1ll);
				sum += mx;
			}
			mn = min(mn, sum);
		}
		c[i] = mn;
	}
	return c;
}

詳細信息

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 1ms
memory: 3840kb

input:

1 1
877914575
0 0

output:

877914575

result:

ok single line: '877914575'

Test #2:

score: 4
Accepted
time: 9ms
memory: 3840kb

input:

3000 10
24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784 450968417 430302156 982631932 161735902 880895728 923078537 707723857 189330739 910286918 802329211 404539679 303238506 317063340 492686568 773361868 125660016 650287940 839296263 462...

output:

1024247893897
387722136748
320221738511
62625315028
1243975980128
764186876430
1636726615471
2196212730526
398559935425
1566325595943

result:

ok 10 lines

Test #3:

score: 4
Accepted
time: 56ms
memory: 3712kb

input:

3000 10
117404628 692055095 755070221 715682811 696968512 271712352 785202148 709222314 720911207 502275390 715733144 543795627 209964105 821671150 770596143 206579953 734002701 607943253 52208145 87434096 718162302 537531289 245587594 955642018 846238857 430102181 858054986 214068227 419338432 1679...

output:

2970277257487
2971276731026
2969277783948
2970277127105
2969277653566
2972276074183
2971276600644
2969277914330
2970277387869
2969278044712

result:

ok 10 lines

Test #4:

score: 4
Accepted
time: 18ms
memory: 3840kb

input:

3000 10
802970485 554311944 721586630 658707597 867826691 707711038 1000000000 741016791 163067996 85733395 241003009 725461344 621176293 79025516 623195351 952981317 734991969 493604980 634606367 590654729 183121695 170334116 792844711 683708723 698569581 514638998 455657098 320766092 995695679 329...

output:

776574440162
1356326000564
439271298101
1601904247765
2447904247765
2474904247765
1034054953531
1553381135555
2372904247765
814110055552

result:

ok 10 lines

Test #5:

score: 4
Accepted
time: 56ms
memory: 3840kb

input:

3000 10
89422491 217744789 368590345 897451494 965706806 321471320 945784293 836203774 345208132 644473122 191708254 492559817 265766886 869220009 530285065 308161250 734166493 800351559 893249518 210697945 971033199 486188338 457056803 737363008 179332548 758076441 938993726 145536925 690071016 808...

output:

2980098167942
2982098167942
2983098167942
2980098167942
2982098167942
2981098167942
2981098167942
2980098167942
2981098167942
2980098167942

result:

ok 10 lines

Test #6:

score: 4
Accepted
time: 5ms
memory: 3840kb

input:

3000 10
428861580 1000000000 214980074 1000000000 480956121 1000000000 412622860 1000000000 657131705 1000000000 642915985 1000000000 760418775 1000000000 45825734 1000000000 472385510 1000000000 451586497 1000000000 465087781 1000000000 19418208 1000000000 963358391 1000000000 904958892 1000000000 ...

output:

249013745371
1981001228307
1460001320035
418001320035
404001320035
1024001320035
644002700861
812001320035
265001240575
479008402753

result:

ok 10 lines

Test #7:

score: 4
Accepted
time: 1ms
memory: 3840kb

input:

3000 10
529364148 767311400 683867782 323707782 332212060 346290951 926542051 631784593 61778356 22988053 737593890 932840690 438698802 764173467 918608362 451459958 932832462 536879367 493105063 663232077 605618054 470041452 278845192 788588427 579564762 294283519 138023551 574595496 416322384 2548...

output:

683867782
323707782
529364148
346290951
926542051
61778356
22988053
767311400
631784593
332212060

result:

ok 10 lines

Test #8:

score: 4
Accepted
time: 2ms
memory: 3840kb

input:

3000 10
178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 178531994 17...

output:

98371128694
98371128694
98371128694
98371128694
98371128694
98371128694
98371128694
98371128694
98371128694
98371128694

result:

ok 10 lines

Test #9:

score: 4
Accepted
time: 55ms
memory: 3840kb

input:

3000 10
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ...

output:

2010996
2010996
2008992
2008988
2012000
2008992
2009992
2009996
2009992
2008988

result:

ok 10 lines

Subtask #2:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Test #10:

score: 0
Time Limit Exceeded

input:

5000 5000
925436622 456168989 114729281 417405856 349595598 120468725 364673377 307424567 641054631 862036501 787093000 623030761 774839764 816160008 619531195 260038235 986705026 740332334 975823092 30962247 403533589 933740602 471221917 45689083 21762724 156618421 362146969 568935385 495753848 883...

output:

Unauthorized output

result:


Subtask #3:

score: 0
Time Limit Exceeded

Test #16:

score: 17
Accepted
time: 0ms
memory: 3840kb

input:

1 1
2
0 0

output:

2

result:

ok single line: '2'

Test #17:

score: 0
Time Limit Exceeded

input:

8014 48643
2 2 1 2 2 1 2 1 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 2 2 2 1 2 1 1 2 1 1 2 1 2 2 1 1 2 2 2 1 1 1 1 2 2 1 1 1 1 1 2 2 2 2 2 2 1 1 2 2 2 1 1 2 1 1 2 2 2 1 2 2 1 1 2 1 1 1 2 1 1 1 1 1 2 2 1 1 2 1 2 2 2 2 2 2 1 2 2 1 2 2 2 1 1 2 1 2 2 1 2 1 1 2 2 2 2 2 2 1 2 2 1 1 1 2 1 1 1 1 2 1 2 2 1 1 1 1 1 1 2...

output:

Unauthorized output

result:


Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%