제출 #1319215

#제출 시각아이디문제언어결과실행 시간메모리
1319215tkm_algorithmsDetecting Molecules (IOI16_molecules)C++20
0 / 100
0 ms332 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; using ll = long long; //#define int ll using P = pair<ll, int>; #define all(x) x.begin(), x.end() #define rep(i, l, n) for (int i = l; i < (n); ++i) #define sz(x) (int)x.size() const char nl = '\n'; const int mod = 1e9+7; vector<int> find_subset(int l, int u, vector<int> w) { vector<P> nw; int n = sz(w); rep(i, 0, n)nw.push_back(P(w[i], i)); sort(all(nw)); ll sm = 0, r = -1; rep(i, 0, n) { if (r < i) r = i, sm = nw[i].first; while (r < n-1 && sm < l)sm += nw[++r].first; if (l <= sm && sm <= r) { vector<int> res; rep(j, i, r+1)res.push_back(nw[i].second); return res; } sm -= nw[i].first; } return {}; }

컴파일 시 표준 에러 (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
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...