| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1097911 | dzhoz0 | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 348 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> sub1(int l, int u, vector<int> w) {
    int n = w.size();
    int cur = 0;
    vector<int> res;
    for(int i = 0; i < n; i++) {
        cur += w[i];
        res.push_back(i);
        if(cur >= l && cur <= u) {
            return res;
        }
    }
    return vector<int>(0);
}
vector<int> sub123(int l, int u, vector<int> w) {
    int n = w.size();
    vector<pair<bool, int>> dp(u + 5, {false, -1});
    dp[0] = {true, -1};
    for(int i = 0; i < n; i++) {
        for(int x = u; x >= w[i]; x--) {
            if(dp[x - w[i]].first == true) {
                dp[x] = {true, i};
            }
        }
    }
    // for(int x = 0; x <= u; x++) {
    //     cout << x << ' ' << dp[x].first << '\n';
    // }
    for(int val = l; val <= u; val++) {
        if(dp[val].first == true) {
            int x = val;
            // cout << x << ' ' << dp[x].second << '\n';
            vector<int> res;
            int id = dp[x].second;
            
            while(id != -1) {
                res.push_back(id);
                // cout << id << '\n';
                x -= w[id];
                id = dp[x].second;
            }
            // cout << res.size() << '\n';
            return res;
        }
    }
    return vector<int>(0);
}
vector<int> find_subset(int l, int u, vector<int> w) {
    int n = w.size();
    // sort(w.begin(), w.end());
    int mx = *max_element(w.begin(), w.end()), mi = *min_element(w.begin(), w.end());
    if(u <= 1000) return sub123(l, u, w);
    return vector<int>(0);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
