제출 #1301160

#제출 시각아이디문제언어결과실행 시간메모리
1301160Math4Life2020Detecting Molecules (IOI16_molecules)C++20
9 / 100
1 ms352 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll,ll>; vector<int> find_subset(int _l, int _u, vector<int> w) { ll l = _l; ll u = _u; sort(w.begin(),w.end()); vector<int> vf; ll N = w.size(); ll pfs[N+1]; pfs[0]=0; for (ll t=0;t<N;t++) { pfs[t+1]=pfs[t]+w[t]; } for (ll T=1;T<=N;T++) { ll smin = pfs[T]; ll smax = pfs[N]-pfs[N-T]; if (smax<l || u<smin) { continue; } for (ll xl=0;xl<T;xl++) { ll bs0 = pfs[xl]+pfs[N]-pfs[N-T-xl+1]; //0, 1, 2, ..., xl-1 //and //N-(T-xl-1), N-(T-xl-2), ..., N-2, N-1 ll vmin = bs0 + w[xl]; ll vmax = bs0 + w[N-T+xl]; if (vmax<l || u<vmin) { continue; } vector<int> vans; for (ll t=0;t<xl;t++) { vans.push_back(t); } for (ll t=(N-T+xl+1);t<N;t++) { vans.push_back(t); } for (ll t=xl;t<=(N-T+xl);t++) { if (l<=(bs0+w[t])&&(bs0+w[t])<=u) { vans.push_back(t); return vans; } } } } return vf; }

컴파일 시 표준 에러 (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...