제출 #76086

#제출 시각아이디문제언어결과실행 시간메모리
76086luciocfDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <molecules> using namespace std; const int MAXN = 2e5+10; typedef long long ll; struct P { int ind; ll v; } num[MAXN]; bool comp(P a, P b) { return a.v < b.v; } ll soma[MAXN]; int busca(int pos, int k, int n) { int ini = pos, fim = n; while (ini <= fim) { int mid = (ini+fim)>>1; if (mid == n && soma[mid]-soma[pos-1] <= k) return mid; else if (mid == n) { fim = mid-1; continue; } if (soma[mid]-soma[pos-1] <= k && soma[mid+1]-soma[pos-1] <= k) ini = mid+1; else if (soma[mid]-soma[pos-1] <= k && soma[mid+1]-soma[pos-1] > k) return mid; else if (soma[mid]-soma[pos-1] > k) fim = mid-1; } return -1; } int find_subset(int l, int r, int w[], int n, int result[]) { for (int i = 1; i <= n; i++) num[i].ind = i-1, num[i].v = w[i-1]; sort(num+1, num+n+1, comp); for (int i = 1; i <= n; i++) soma[i] = soma[i-1]+num[i].v; int ini = -1, fim = -1; for (int i = 1; i <= n; i++) { int pos = busca(i, r, n); if (pos == -1) continue; if (soma[pos]-soma[i-1] >= l) { ini = i, fim = pos; break; } } if (ini == -1) return 0; int ind = -1; for (int i = ini; i <= fim; i++) result[++ind] = num[i].ind; return ind+1; }

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp:2:10: fatal error: molecules: No such file or directory
 #include <molecules>
          ^~~~~~~~~~~
compilation terminated.