# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
239256 | 2020-06-15T02:04:22 Z | urd05 | Detecting Molecules (IOI16_molecules) | C++14 | 5 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; long long dp[10001][170]; bool val(int x,int y) { return (dp[x][y/64]>>(y%64))&1; } vector<int> find_subset(int l, int u,vector<int> w) { dp[0][0]=1; for(int i=0;i<w.size();i++) { int ind=i+1; for(int j=0;j<=u;j++) { if (j+w[i]<=u) { if (val(ind-1,j)) { dp[ind][(j+w[i])/64]|=(1<<((j+w[i])%64)); } } if (val(ind-1,j)) { dp[ind][j/64]|=(1<<(j%64)); } } } int n=w.size(); int pos=-1; for(int i=l;i<=u;i++) { if (val(n,i)) { pos=i; } } if (pos==-1) { vector<int> emp; return emp; } vector<int> ret; int sum=pos; for(int i=n-1;i>=0;i--) { if (sum>=w[i]&&val(i,sum-w[i])) { ret.push_back(i); sum-=w[i]; } } return ret; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 4 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 4 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 4 ms | 256 KB | Contestant can not find answer, jury can |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | sum of weights should be in [302..304] but it is 102 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 4 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 4 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 4 ms | 256 KB | Contestant can not find answer, jury can |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 4 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 4 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 4 ms | 256 KB | Contestant can not find answer, jury can |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 4 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 4 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 4 ms | 256 KB | Contestant can not find answer, jury can |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 4 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 4 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Incorrect | 4 ms | 256 KB | Contestant can not find answer, jury can |
5 | Halted | 0 ms | 0 KB | - |