답안 #718885

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
718885 2023-04-05T04:53:14 Z ACtor Detecting Molecules (IOI16_molecules) C++17
0 / 100
1000 ms 340 KB
#include<bits/stdc++.h>

using namespace std;

// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")

//using namespace chrono;

typedef long long ll;
typedef unsigned long long ull;
typedef vector< int > vi;
typedef vector< ll > V;
typedef map<int, int > mp;

#define pb push_back
#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define F first
#define S second

#define debug cout << -1 << endl;
#define REP(i, a, b) for(int i=a; i<b; i++)
#define f0r(i, n) for (int i = 0; i < n; ++i)
#define f0r1(i, n) for (int i = 1; i <= n; ++i)
#define r0f(i, n) for(int i=n-1; i>=0; i--)
#define r0f1(i, n) for(int i=n; i>=1; i--)
#define fore(a, x) for (auto& a : x)
#define fori(i, a, b) for (int i = (a); i < (b); ++i)

#define MP make_pair
#define UB upper_bound
#define LB lower_bound
#define nw cout << "\n"

#define issq(x) (((ll)(sqrt((x))))*((ll)(sqrt((x))))==(x))
#define rev(v) reverse(v.begin(),v.end())
#define asche cerr<<"Ekhane asche\n";
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<ll>())
#define all(v) v.begin(),v.end()
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define valid(tx,ty) (tx>=0 && tx<r && ty>=0 && ty<n)
#define one(x) __builtin_popcount(x)

#define dag cerr << "-----------------------------------------\n";


//#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>

//#define pop pop_back
#define setPrec(x) cout << fixed << setprecision(x)

// typedef tree<int, null_type, less<int>, rb_tree_tag,
// tree_order_statistics_node_update> ordered_set;

// int count(int l, int r, ordered_set &st) {
//     return st.order_of_key(r+1) - st.order_of_key(l);
// }

// #define sz(a) (int)a.sz()
//#define fin cin
//#define fout cout
const int INF = 1e9;
const ll MOD = (ll)1e9+7;
const ll INFL = 1e18;
const ll mnINF = -1e18;
const double diff = 10e-6;
const int maxn = 1000002;
const int MX = 100002;
const double PI = acos(-1);
using namespace std;
#define MAX 10000002


const double bruh = .00000001;

// int dx[] = {-1, 0, 1};
// int dy[] = {-1, 0, 1};

int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
// int dx[] = {0, 1};
// int dy[] = {-1, 0};

const int N = 1002;

bool f = false;

void func(int indx, ll s, int l, int u, vector< int > &ans2, vector< int > w)
{
    if(s>=l && s<=u) {
        f = true;
        // for(auto x: ans2) cout << x << " ";
        //     nw;
        // cout << ans2.size() << "\n";
        return;
    }
    if(indx<0 || s>u) return;
    if(f) return;
    ans2.pb(indx);
    func(indx-1, s+w[indx], l, u, ans2, w);
    if(f) return;
    ans2.pop_back();
    if(f) return;
    func(indx-1, s, l, u, ans2, w);
    return;
}

vector< int > find_subset(int l, int u, vector< int > w) {
    int n = w.size();
    vector< int > ans2;
    func(n-1, 0LL, l, u, ans2, w);
    return ans2;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 1, answer = NO)
2 Correct 1 ms 212 KB OK (n = 1, answer = NO)
3 Correct 1 ms 212 KB OK (n = 1, answer = YES)
4 Correct 1 ms 292 KB OK (n = 2, answer = YES)
5 Correct 1 ms 212 KB OK (n = 2, answer = YES)
6 Correct 1 ms 212 KB OK (n = 3, answer = YES)
7 Correct 1 ms 212 KB OK (n = 3, answer = YES)
8 Correct 1 ms 296 KB OK (n = 3, answer = YES)
9 Correct 1 ms 292 KB OK (n = 3, answer = YES)
10 Correct 1 ms 212 KB OK (n = 3, answer = YES)
11 Correct 1 ms 212 KB OK (n = 3, answer = YES)
12 Correct 1 ms 212 KB OK (n = 3, answer = YES)
13 Correct 1 ms 212 KB OK (n = 3, answer = NO)
14 Correct 1 ms 212 KB OK (n = 3, answer = YES)
15 Correct 1 ms 304 KB OK (n = 3, answer = YES)
16 Correct 1 ms 300 KB OK (n = 3, answer = NO)
17 Correct 0 ms 212 KB OK (n = 3, answer = NO)
18 Execution timed out 1088 ms 340 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 12, answer = YES)
2 Correct 1 ms 212 KB OK (n = 12, answer = YES)
3 Correct 1 ms 304 KB OK (n = 12, answer = NO)
4 Correct 1 ms 212 KB OK (n = 12, answer = NO)
5 Correct 1 ms 212 KB OK (n = 12, answer = YES)
6 Correct 1 ms 212 KB OK (n = 12, answer = YES)
7 Correct 1 ms 212 KB OK (n = 12, answer = YES)
8 Correct 1 ms 300 KB OK (n = 12, answer = YES)
9 Correct 1 ms 212 KB OK (n = 6, answer = YES)
10 Correct 1 ms 212 KB OK (n = 12, answer = YES)
11 Execution timed out 1075 ms 340 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 1, answer = NO)
2 Correct 1 ms 212 KB OK (n = 1, answer = NO)
3 Correct 1 ms 212 KB OK (n = 1, answer = YES)
4 Correct 1 ms 292 KB OK (n = 2, answer = YES)
5 Correct 1 ms 212 KB OK (n = 2, answer = YES)
6 Correct 1 ms 212 KB OK (n = 3, answer = YES)
7 Correct 1 ms 212 KB OK (n = 3, answer = YES)
8 Correct 1 ms 296 KB OK (n = 3, answer = YES)
9 Correct 1 ms 292 KB OK (n = 3, answer = YES)
10 Correct 1 ms 212 KB OK (n = 3, answer = YES)
11 Correct 1 ms 212 KB OK (n = 3, answer = YES)
12 Correct 1 ms 212 KB OK (n = 3, answer = YES)
13 Correct 1 ms 212 KB OK (n = 3, answer = NO)
14 Correct 1 ms 212 KB OK (n = 3, answer = YES)
15 Correct 1 ms 304 KB OK (n = 3, answer = YES)
16 Correct 1 ms 300 KB OK (n = 3, answer = NO)
17 Correct 0 ms 212 KB OK (n = 3, answer = NO)
18 Execution timed out 1088 ms 340 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 1, answer = NO)
2 Correct 1 ms 212 KB OK (n = 1, answer = NO)
3 Correct 1 ms 212 KB OK (n = 1, answer = YES)
4 Correct 1 ms 292 KB OK (n = 2, answer = YES)
5 Correct 1 ms 212 KB OK (n = 2, answer = YES)
6 Correct 1 ms 212 KB OK (n = 3, answer = YES)
7 Correct 1 ms 212 KB OK (n = 3, answer = YES)
8 Correct 1 ms 296 KB OK (n = 3, answer = YES)
9 Correct 1 ms 292 KB OK (n = 3, answer = YES)
10 Correct 1 ms 212 KB OK (n = 3, answer = YES)
11 Correct 1 ms 212 KB OK (n = 3, answer = YES)
12 Correct 1 ms 212 KB OK (n = 3, answer = YES)
13 Correct 1 ms 212 KB OK (n = 3, answer = NO)
14 Correct 1 ms 212 KB OK (n = 3, answer = YES)
15 Correct 1 ms 304 KB OK (n = 3, answer = YES)
16 Correct 1 ms 300 KB OK (n = 3, answer = NO)
17 Correct 0 ms 212 KB OK (n = 3, answer = NO)
18 Execution timed out 1088 ms 340 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 1, answer = NO)
2 Correct 1 ms 212 KB OK (n = 1, answer = NO)
3 Correct 1 ms 212 KB OK (n = 1, answer = YES)
4 Correct 1 ms 292 KB OK (n = 2, answer = YES)
5 Correct 1 ms 212 KB OK (n = 2, answer = YES)
6 Correct 1 ms 212 KB OK (n = 3, answer = YES)
7 Correct 1 ms 212 KB OK (n = 3, answer = YES)
8 Correct 1 ms 296 KB OK (n = 3, answer = YES)
9 Correct 1 ms 292 KB OK (n = 3, answer = YES)
10 Correct 1 ms 212 KB OK (n = 3, answer = YES)
11 Correct 1 ms 212 KB OK (n = 3, answer = YES)
12 Correct 1 ms 212 KB OK (n = 3, answer = YES)
13 Correct 1 ms 212 KB OK (n = 3, answer = NO)
14 Correct 1 ms 212 KB OK (n = 3, answer = YES)
15 Correct 1 ms 304 KB OK (n = 3, answer = YES)
16 Correct 1 ms 300 KB OK (n = 3, answer = NO)
17 Correct 0 ms 212 KB OK (n = 3, answer = NO)
18 Execution timed out 1088 ms 340 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB OK (n = 1, answer = NO)
2 Correct 1 ms 212 KB OK (n = 1, answer = NO)
3 Correct 1 ms 212 KB OK (n = 1, answer = YES)
4 Correct 1 ms 292 KB OK (n = 2, answer = YES)
5 Correct 1 ms 212 KB OK (n = 2, answer = YES)
6 Correct 1 ms 212 KB OK (n = 3, answer = YES)
7 Correct 1 ms 212 KB OK (n = 3, answer = YES)
8 Correct 1 ms 296 KB OK (n = 3, answer = YES)
9 Correct 1 ms 292 KB OK (n = 3, answer = YES)
10 Correct 1 ms 212 KB OK (n = 3, answer = YES)
11 Correct 1 ms 212 KB OK (n = 3, answer = YES)
12 Correct 1 ms 212 KB OK (n = 3, answer = YES)
13 Correct 1 ms 212 KB OK (n = 3, answer = NO)
14 Correct 1 ms 212 KB OK (n = 3, answer = YES)
15 Correct 1 ms 304 KB OK (n = 3, answer = YES)
16 Correct 1 ms 300 KB OK (n = 3, answer = NO)
17 Correct 0 ms 212 KB OK (n = 3, answer = NO)
18 Execution timed out 1088 ms 340 KB Time limit exceeded
19 Halted 0 ms 0 KB -