UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#214937#3856. 排序one_zero_four_zero10134ms4940kbC++11511b2024-11-24 10:57:062024-11-24 13:15:23

answer

#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;

int N;
int A[500005];
vector<pair<int, int>> it;

int main(){
#ifndef ONLINE_JUDGE
	freopen("../data.in", "r", stdin);
	freopen("../data.out", "w", stdout);
#endif

	scanf("%d", &N);
	A[0] = 11451419;
	int pos = 1;
	for (int i = 1; i <= N; i ++){
		scanf("%d", &A[i]);
		if (A[i] < A[i - 1]) continue;
		it.push_back({pos, i - 1});
		pos = i;
	}
	it.push_back({pos, N});
	printf("%d\n", it.size());

	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

475
319 474 473 472 471 183 108 346 43 466 465 464 168 462 461 309 459 458 457 456 455 38 372 312 94...

output:

164

result:

wrong answer 1st numbers differ - expected: '11', found: '164'

Subtask #2:

score: 0
Skipped

Subtask #3:

score: 10
Accepted

Test #9:

score: 10
Accepted
time: 47ms
memory: 3508kb

input:

499758
77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 ...

output:

55744

result:

ok 1 number(s): "55744"

Test #10:

score: 0
Accepted
time: 44ms
memory: 3504kb

input:

498773
255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 2...

output:

55362

result:

ok 1 number(s): "55362"

Subtask #4:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 43ms
memory: 4940kb

input:

466818
447360 121353 327541 289718 71942 242279 307652 438765 78054 253024 190170 21720 292462 72832...

output:

233375

result:

wrong answer 1st numbers differ - expected: '32', found: '233375'

Subtask #5:

score: 0
Skipped