QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#403370#8124. Vrsarlfxxx#17 40ms5804kbC++14947b2024-05-02 09:38:402024-05-02 09:38:41

Judging History

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

  • [2024-05-02 09:38:41]
  • 评测
  • 测评结果:17
  • 用时:40ms
  • 内存:5804kb
  • [2024-05-02 09:38:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define all(x) (x).begin(), (x).end()
bool be;
constexpr int N = 1e5 + 5;
int n, m, b[N], suf[N];
struct node {
	int x, t, s;
}a[N];
bool en;
int main()
{
	cerr << (&be - &en) / 1024.0 / 1024 << " MB\n--------------------------------" << endl;
#ifdef IAKIOI
	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].t >> a[i].s;
	sort(a + 1, a + 1 + n, [](node a, node b) {
		return a.x < b.x;
	});
	for (int i = 1; i <= n; ++i) b[i] = a[i].x;
	for (int i = n; i >= 1; --i) {
		suf[i] = max(suf[i + 1], a[i].t - b[i]);
	}
	while (m--) {
		int x;
		cin >> x;
		int p = lower_bound(b + 1, b + 1 + n, x) - b;
		cout << suf[p] + x << ' ';
	}
	return 0;
}

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: 3792kb

input:

10 10
466367251 100233480 856646172
23616136 95836624 848167799
285824526 504732766 778781745
484144310 45902528 249884410
77146428 247312488 457658792
303741999 449119889 822567584
310490877 635450008 523068941
688770771 830721934 666426060
895820438 617674687 350595970
688493520 120110545 31964270...

output:

324959131 778061457 492307021 409366057 787995914 441429980 363382174 592662119 864828222 452101770 

result:

wrong answer 3rd numbers differ - expected: '595585027', found: '492307021'

Subtask #2:

score: 17
Accepted

Test #7:

score: 17
Accepted
time: 21ms
memory: 5740kb

input:

100000 1
53320039 48316003 37819925
770863640 910315870 957734835
466906749 791126408 442399500
312027241 11301038 565496103
691485660 603958964 574732654
989479682 728111217 647104072
843191799 685573031 570351670
169795677 685358070 641488997
795703430 994805186 294018870
21473670 875523013 991777...

output:

995983978 

result:

ok 1 number(s): "995983978"

Test #8:

score: 17
Accepted
time: 25ms
memory: 5744kb

input:

100000 1
685937245 290795880 211005526
177778952 802905227 983869446
454912298 343628505 28321462
38243172 631075776 619487766
682651221 240289602 457322605
189471916 957198086 18483085
954626959 191915417 167067901
183628752 126948548 119039254
768289318 34004952 306991192
859775708 740006350 69621...

output:

994454920 

result:

ok 1 number(s): "994454920"

Test #9:

score: 17
Accepted
time: 21ms
memory: 5700kb

input:

100000 1
789191504 222974467 26132393
643171429 29199427 429975930
93253098 986888132 818435231
622741039 92276295 625805057
415151319 82624176 231548476
709476321 824999732 515903661
202334222 501136586 414116115
329414984 918271019 283604940
350067855 973975089 40828573
862084361 617785313 3436328...

output:

999684354 

result:

ok 1 number(s): "999684354"

Test #10:

score: 17
Accepted
time: 18ms
memory: 5800kb

input:

100000 1
604474130 537620598 984504818
636918864 686701808 971616217
458766000 474373841 771601549
67713650 632411948 620684266
451553645 299309648 658068372
144019942 384532023 199919637
882493353 601022916 773880686
692096494 765549801 447544786
966280814 84732023 337666483
714553341 719139035 739...

output:

996678183 

result:

ok 1 number(s): "996678183"

Test #11:

score: 17
Accepted
time: 25ms
memory: 5800kb

input:

100000 1
852429235 916671092 532162590
8966928 790503806 940949256
397323085 213656308 750563499
43785611 637035777 248288048
355962441 365117831 490415665
340083831 211575355 25978716
138144527 577500394 229977301
94301080 551812543 232449187
585483001 615451515 628855963
181158516 954102989 794751...

output:

995372091 

result:

ok 1 number(s): "995372091"

Test #12:

score: 17
Accepted
time: 17ms
memory: 5728kb

input:

100000 1
625668756 968912537 869988252
581954375 955236546 979655664
389902987 475748907 317532424
331593993 345131384 339186032
478145777 498003101 501582528
321211625 502307105 719388732
183678728 424664429 884081646
591958022 744966912 43677765
861504705 386449465 771737197
992667988 775159187 27...

output:

994593331 

result:

ok 1 number(s): "994593331"

Subtask #3:

score: 0
Wrong Answer

Test #13:

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

input:

1000 1000
772002074 896000991 264744112
388854298 98924088 455149297
417376884 380862219 489995490
623600709 227967696 504868695
730017345 324800592 430914592
822596051 922354700 720756605
520694263 298084968 334175049
355696669 7751208 295045433
209898888 775145315 36300658
449506116 200580532 9933...

output:

961452637 964911464 987335755 977388705 949627100 955954383 964241598 986687731 993577128 986478605 936955220 907327801 985155209 977564325 952451522 950516357 981827422 949129298 948117186 966756309 965677563 959798079 986999624 947644918 956210887 967250753 983327497 919815577 985297316 952614917 ...

result:

wrong answer 2nd numbers differ - expected: '952290361', found: '964911464'

Subtask #4:

score: 0
Wrong Answer

Test #23:

score: 0
Wrong Answer
time: 40ms
memory: 5804kb

input:

100000 100000
521965876 33870591 856400954
206067435 592933982 931261262
178283709 147934752 282409736
563063581 870421027 970567928
631801897 450778938 362656247
144968633 956983527 74676772
269211495 65706335 924510921
808188509 607096121 593666067
121621532 157123020 318243015
690651288 997566425...

output:

999323122 997589739 995903104 996574971 995409305 997815312 995758480 996388828 993441839 995864173 992401532 998474565 995523032 991408491 996510806 997307718 994545177 995654295 996326351 996624761 991687989 997380958 995494564 996030702 993053225 993494938 996066677 995573739 995668115 995919327 ...

result:

wrong answer 3rd numbers differ - expected: '996663287', found: '995903104'