제출 #1244377

#제출 시각아이디문제언어결과실행 시간메모리
1244377SpyrosAlivDetecting Molecules (IOI16_molecules)C++17
9 / 100
0 ms328 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<pair<ll, int>> vals;
    for (int i = 0; i < n; i++) vals.push_back({w[i], i});
    sort(vals.begin(), vals.end());
    ll tot = 0;
    vector<int> ans;
    for (int i = n-1; i >= 0; i--) {
        if (tot + vals[i].first > u) continue;
        tot += vals[i].first;
        ans.push_back(vals[i].second);
        if (tot >= l && tot <= u) return ans;
    }
    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...