답안 #968934

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
968934 2024-04-24T09:51:46 Z CyberCow A Difficult(y) Choice (BOI21_books) C++17
0 / 100
1 ms 864 KB
#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 = 1;
    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->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();
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 436 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 864 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -