Submission #1244966

#TimeUsernameProblemLanguageResultExecution timeMemory
1244966hmms127Detecting Molecules (IOI16_molecules)C++20
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define ll long long const int MN = 1e4+5; const int MV = 1e4+5; int dp[MV]; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int n=w.size(); vector<array<int,2>> v; for(int i=0;i<n;i++){ v.push_back({w[i],i}); } sort(v.begin(),v.end()); int r=0;long long sm=0; f1(n){ while(r<n&&sm+v[r][0]<=u)sm+=v[r++][0]; if(sm>=l){ vector<int>ans; for(int j=i;j<r;j++)ans.push_back(v[j][1]); return ans; } sm-=a[i]; } return {}; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:19:5: error: 'f1' was not declared in this scope; did you mean 'y1'?
   19 |     f1(n){
      |     ^~
      |     y1
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~