제출 #1306022

#제출 시각아이디문제언어결과실행 시간메모리
1306022not_suprised__Detecting Molecules (IOI16_molecules)C++20
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <climits> #include <stack> #include <map> #include <unordered_set> #include <cmath> #include <iomanip> #include <bitset> #include <queue> using namespace std; #define int long long #define pii pair<int, int> #define fi first #define se second #define all(a) begin(a), end(a) #define pb push_back #define nl '\n' #define sz(x) (int)x.size() #define in insert #define speed ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define ppb pop_back #define ld long double const int N = 2e5 + 10; const int mod = 998244353; int gcd(int a, int b) { if(!b) return a; return gcd(b, a % b); } const int C = 1e9 + 10; const int INF = LLONG_MAX; bitset<N> b; void solve() { int n, l, r; cin >> n >> l >> r; vector<int> a(n); int need = -1; b[0] = 1; for(int i = 0; i < n; i++) cin >> a[i], b |= (b << a[i]); for(int i = l; i <= r; i++) { if(b[i]) { need = i; break; } } if(need == -1) { cout << "-1\n"; return; } vector<int> ans; for(int i = 0; i < n; i++) { b >>= a[i]; if(!b[need]) { ans.pb(i); need -= a[i]; } } for(int i : ans) cout << i+1 << ' '; cout << nl; } signed main() { speed; int T = 1; //cin >> T; for(int _ = 0; _ < T; _++) solve(); } /* 4 amir rima amin nim */

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

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
      |         ^~~~
/usr/bin/ld: /tmp/ccod7pbZ.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccJNtcpK.o:molecules.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccod7pbZ.o: in function `main':
grader.cpp:(.text.startup+0x165): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status