#include <bits/stdc++.h>
using namespace std;
const int mxm = 5e5+5;
using ll = long long;
struct Button {
ll a, t;
bool operator<(const Button& other) {
return t < other.t;
}
};
Button B[mxm];
int main(int argc, char const *argv[]) {
int n, m; cin >> n >> m;
for(int i = 0; i < m; i++) cin >> B[i].a;
for(int i = 0; i < m; i++) cin >> B[i].t;
sort(B, B+m);
bool poss1 = true;
ll x = B[0].a;
for(int i = 1; i < m; i++) {
if(labs(B[i].a-x) > B[i].t-B[i-1].t) {
poss1 = false;
}
x = B[i].a;
}
cout << (poss1 ? 1 : 2) << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
154 ms |
4860 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
158 ms |
4956 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
119 ms |
4816 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
119 ms |
4816 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |