# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
290768 | 2020-09-04T12:31:49 Z | REALITYNB | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 256 KB |
#include <bits/stdc++.h> #define ll long long #define all(a) a.begin(),a.end() #define mp make_pair #define F first #define S second #define pii pair<int,int> using namespace std; vector<int> find_subset(int l , int r , vector<int> a){ int sum= 0 ; for(int x :a) sum+= x ; set<int> ans ; int n = a.size() ; for(int i=0;i<n;i++) ans.insert(i) ; vector<int> re ; set<pii> b ; for(int i=0;i<a.size();i++) b.insert(mp(a[i],i)) ; if(sum<l) return re ; while(1){ if(b.empty()) break ; if(sum>r) break ; auto it = b.end() ; it-- ; pii w = *it ; if(sum-w.F>r){ sum-=w.F ; b.erase(it) ; ans.erase(w.S) ; } else if(sum-w.F<l){ b.erase(it) ; } else{ b.erase(it) ; ans.erase(w.S) ; sum-=w.F ; } } if(sum>r||l>sum) return re ; // cout << 1 << " " ; for(int x : ans) re.push_back(x) ; return re ; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
3 | Correct | 0 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 0 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Incorrect | 0 ms | 256 KB | Contestant can not find answer, jury can |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Contestant can not find answer, jury can |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
3 | Correct | 0 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 0 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Incorrect | 0 ms | 256 KB | Contestant can not find answer, jury can |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
3 | Correct | 0 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 0 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Incorrect | 0 ms | 256 KB | Contestant can not find answer, jury can |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
3 | Correct | 0 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 0 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Incorrect | 0 ms | 256 KB | Contestant can not find answer, jury can |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 0 ms | 256 KB | OK (n = 1, answer = NO) |
3 | Correct | 0 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 0 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Incorrect | 0 ms | 256 KB | Contestant can not find answer, jury can |
6 | Halted | 0 ms | 0 KB | - |