Submission #574843

#TimeUsernameProblemLanguageResultExecution timeMemory
574843MajidA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
// #include<books.h>
using namespace std;
using ll = long long;
using db = double;
#define pb push_back
#define sz(vec) ((ll)vec.size())
#define all(vec) vec.begin(), vec.end()
#define f first
#define s second
const int MOD = 1e9 + 7;
const ll BIGINF = ((ll)1e18) + 7;
#define Speeed ios::sync_with_stdio(0);cin.tie(NULL); cout.tie(NULL);

// ll answer(vector<int> x){
// 
//     cout<<"ok";
// }
// 
// ll skim(ll x){
// 
//     return x+2;
// }
// 
// void impossible(){
// 
//     cout<<"not ok";
// }

void solve(int n, int k, ll a, int s){
    
    vector<ll> vec(n);
    
    for(ll i = 0; i < n; i++){
        
        vec[i] = skim(i+1);
    }
    
    ll sum = 0;

    if(k==3){
        
        for(ll i = 0; i < n; i++){
            for(ll j = i+1; j < n; j++){
                for(ll l = j+1; l < n; l++){
                        
                    ll sum = vec[i] + vec[j] + vec[l];
                    
                    if(sum>=a and sum<=2*a){
                        
                        vector<int> temp(3);
                        temp.pb(vec[i]);
                        temp.pb(vec[j]);
                        temp.pb(vec[l]);
                        answer(temp);
                    }
                }
                
            }
            
        }
    }

impossible();
    // answer(temp);
    
    
}
// 
// int main(){
// 
//     solve(5, 3, 10, 0);
// }

Compilation message (stderr)

books.cpp: In function 'void solve(int, int, ll, int)':
books.cpp:36:18: error: 'skim' was not declared in this scope
   36 |         vec[i] = skim(i+1);
      |                  ^~~~
books.cpp:55:25: error: 'answer' was not declared in this scope
   55 |                         answer(temp);
      |                         ^~~~~~
books.cpp:64:1: error: 'impossible' was not declared in this scope
   64 | impossible();
      | ^~~~~~~~~~
books.cpp:39:8: warning: unused variable 'sum' [-Wunused-variable]
   39 |     ll sum = 0;
      |        ^~~