# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
137365 | 2019-07-27T14:11:59 Z | Hassoony | Detecting Molecules (IOI16_molecules) | C++17 | 2 ms | 376 KB |
#include <bits/stdc++.h> #include "molecules.h" //#include "grader.cpp" using namespace std; typedef long long ll; const int MX=10002; bool dp[MX]; int last[MX]; vector<int> find_subset(int l, int u, vector<int> w) { dp[0]=1; last[0]=-1; for(int i=0;i<w.size();i++){ for(int j=u;j>=0;j--){ if(j-w[i] >= 0){ if(dp[j-w[i]])dp[j]=1,last[j]=i; } } } vector<int>ret; int id=-1; for(int i=l;i<=u;i++){ if(dp[i]){id=i;break;} } if(id==-1)return ret; while(last[id]!=-1){ ret.push_back(last[id]); id-=w[ret.back()]; } return ret; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 376 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 2 ms | 256 KB | item #1 is taken twice |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | item #11 is taken twice |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 376 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 2 ms | 256 KB | item #1 is taken twice |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 376 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 2 ms | 256 KB | item #1 is taken twice |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 376 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 2 ms | 256 KB | item #1 is taken twice |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 376 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 2 ms | 256 KB | item #1 is taken twice |
5 | Halted | 0 ms | 0 KB | - |