Submission #1333745

#TimeUsernameProblemLanguageResultExecution timeMemory
1333745zhehanA Difficult(y) Choice (BOI21_books)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

#include "books.h"

using namespace std;
//
// --- Sample implementation for the task books ---
//
// To compile this program with the sample grader, place:
//     books.h books_sample.cpp sample_grader.cpp
// in a single folder and run:
//     g++ books_sample.cpp sample_grader.cpp
// in this folder.
//

void solve(int N, int K, long long A, int S) {
  // TODO implement this function
  vector<int> books(N, 0);
  for (int i = 1; i <= N; ++i) {
    books[i-1] = skim(i);
  }
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      int ind =
          lower_bound(books.begin(), books.end(), A - books[i] - books[j]) -
          books.begin();
      if (books[i] + books[j] + books[ind] < 2 * A && ) {
        answer(vector<int>{i, j, ind});
      }
    }
  }
  impossible();
}

Compilation message (stderr)

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:27:55: error: expected primary-expression before ')' token
   27 |       if (books[i] + books[j] + books[ind] < 2 * A && ) {
      |                                                       ^