#include "books.h"
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
using namespace std;
const int N = 100010;
long long v[N];
void solve(int n, int k, long long a, int s) {
set<pair<long long, int>> se;
for (int i = 1; i <= n; i++)
{
v[i] = skim(i);
se.insert({ v[i], i });
}
int st = 0;
for (int i = 1; i <= n; i++)
{
for (int j = i + 1; j <= n; j++)
{
if (!st && v[i] + v[j] <= 2 * a)
{
auto it = se.lower_bound({ a - v[i] - v[j], 0});
if (it != se.end() && it->first + v[i] + v[j] <= 2 * a && it->first + v[i] + v[j] >= a && it->first != v[i] && it->first != v[j])
{
st = 1;
vector<int> ans;
ans.push_back(i);
ans.push_back(j);
ans.push_back(it->second);
sort(ans.begin(), ans.end());
answer({ ans });
}
}
}
}
if (st == 0)
{
impossible();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
432 KB |
Output is correct |
2 |
Correct |
4 ms |
480 KB |
Output is correct |
3 |
Correct |
6 ms |
700 KB |
Output is correct |
4 |
Correct |
10 ms |
496 KB |
Output is correct |
5 |
Correct |
5 ms |
984 KB |
Output is correct |
6 |
Correct |
5 ms |
732 KB |
Output is correct |
7 |
Correct |
7 ms |
684 KB |
Output is correct |
8 |
Correct |
5 ms |
876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1116 KB |
Output is correct |
2 |
Correct |
4 ms |
1004 KB |
Output is correct |
3 |
Correct |
4 ms |
740 KB |
Output is correct |
4 |
Correct |
12 ms |
624 KB |
Output is correct |
5 |
Correct |
4 ms |
496 KB |
Output is correct |
6 |
Correct |
4 ms |
744 KB |
Output is correct |
7 |
Correct |
5 ms |
712 KB |
Output is correct |
8 |
Correct |
6 ms |
888 KB |
Output is correct |
9 |
Incorrect |
118 ms |
3456 KB |
Incorrect |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |