用户输出
0 2
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#68984 | #1151. 把你挂在地灵殿门口当装饰品! | Accepted | 100 | 131 ms | 1144 K | C++ 11 / 1.0 K | 该起什么名字 | 2022-04-23 5:36:47 |
#include <bits/stdc++.h>
#define F(i, n, m) for (int i = n; i < m; i++)
#define f(i, n, m) for (int i = n; i > m; i--)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
inline int read() {
int num = 0;
char c;
bool flag = false;
while ((c = getchar()) == ' ' || c == '\n' || c == '\r')
;
if (c == '-')
flag = true;
else
num = c - '0';
while (isdigit(c = getchar())) num = num * 10 + c - '0';
return (flag ? -1 : 1) * num;
}
int zd[200005];
int main() {
std::ios::sync_with_stdio(false);
int n;
n = read();
int posA, posB, posC;
posA = posB = posC = 0;
F(i, 0, n) zd[i] = read();
F(i, 0, n - 1) if (zd[i] > zd[i + 1]) {
posA = i;
break;
}
int ls = n;
f(i, n - 1, -1) if (zd[i] == ls) {
posC = i;
ls--;
}
int flag = 1;
f(i, n - 1, -1) {
if (zd[i] < zd[posC]) {
if (zd[i] <= ls) {
posB = i;
ls = zd[i];
// cout<<ls<<endl;
} else {
if (i > posA)
flag = 0;
break;
}
}
}
// cout<<posC<<posB<<posA<<endl;
if (flag)
cout << min(posB, posC) << " " << posA + 1;
else
cout << -1 << " " << -1;
return 0;
}
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
99793 101989
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
99439 102575
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
99526 103431
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
98873 107693
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
99404 103262
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
89805 90017
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3
<1288805 bytes omitted>
用户输出
89614 90080
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3
<1288805 bytes omitted>
用户输出
89785 90028
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 28 30 31 32 34 35 36 37
<1288805 bytes omitted>
用户输出
89789 90119
系统信息
Exited with return code 0
200000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<1288805 bytes omitted>
用户输出
89563 90067
系统信息
Exited with return code 0
200000
1 2 4 5 7 8 9 12 13 14 16 18 19 21 22 23 25 27 29 30 33 35 38 40 41 42 43 44 47 50 51 52 53
<1288805 bytes omitted>
用户输出
49769 50000
系统信息
Exited with return code 0
200000
1 4 5 9 10 11 13 14 15 16 20 21 25 26 28 31 32 33 35 36 37 38 39 40 41 42 45 46 47 56 58 59
<1288805 bytes omitted>
用户输出
49733 50034
系统信息
Exited with return code 0
200000
1 4 5 6 7 9 10 11 16 19 20 21 22 23 29 33 38 40 41 42 43 44 49 50 51 52 54 55 57 60 61 63 64
<1288805 bytes omitted>
用户输出
49924 50004
系统信息
Exited with return code 0
200000
3 4 9 11 13 14 15 18 20 22 23 24 25 27 30 32 34 37 40 43 44 47 48 49 50 51 60 62 63 65 67 69
<1288805 bytes omitted>
用户输出
49925 50006
系统信息
Exited with return code 0