Submission #1219306

#TimeUsernameProblemLanguageResultExecution timeMemory
1219306LIADetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms324 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef tuple <ll,ll,ll> plll; typedef vector <plll> vplll; typedef pair <ll,ll> pll; typedef vector <ll> vll; typedef vector <pll> vpll; typedef vector <vector <pll>> vvpll; typedef vector <vector <ll>> vvll; typedef vector <bool> vb; typedef vector <vector <bool>> vvb; #define loop(i, s, e) for (ll i = (s); i < (e); ++i) #define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i) #define all(a) a.begin(), a.end() const ll inf = 1e9 + 7; std::vector<int> find_subset(int l, int u, std::vector<int> w) { ll n = w.size(); ll sum = 0; vpll v(n); loop(i,0,n) v[i] = {w[i], i}; sort(all(v)); loop(i,0,n) { if (v[i].first == l || v[i].first == u) return {(int)i}; } for (auto [x,idx] : v) { if (x>=l && x<=u) { return {(int)idx}; } else { auto it = lower_bound(v.begin(), v.end(), make_pair(u - x, -inf)); if (it!= v.end()){ ll sec = it->second; return {(int)idx, (int)sec}; } } } return {}; }

Compilation message (stderr)

molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...