Submission #1262337

#TimeUsernameProblemLanguageResultExecution timeMemory
1262337bangchanDetecting Molecules (IOI16_molecules)C++20
19 / 100
0 ms328 KiB
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <limits.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<double> vd; typedef vector<string> vs; typedef vector<vi> vvi; typedef pair<int,int> pii; typedef vector<pii> vii; typedef map<int, int> mii; typedef vector<vl> vvl; typedef pair<ll, ll> pll; typedef vector<pll> vpl; #define F first #define S second #define yes cout << "YES" << endl #define no cout << "NO" << endl #define pb push_back #define forn(i, x, n) for (ll i = x; i < n; i++) #define mod 1000000007 #define inf 10000000000000 vi find_subset(int l, int u, vi w){ vi r, mint, maxs; ll mi = *min_element(w.begin(), w.end()); ll ma = *max_element(w.begin(), w.end()); forn(i, 0, w.size()){ if(w[i] == mi) mint.pb(i); else maxs.pb(i); } ll n = 0, n1 = 0; if(mi == ma){ ll nn = 0; forn(i, 1, w.size() + 1){ if(l <= (w[0] * i) && w[0] * i <= u) nn = i; } forn(i, 0, nn) r.pb(i); return r; } forn(i, 0, mint.size() + 1){ forn(j, 0, maxs.size() + 1){ if(l <= ((mi * i) + (ma * j)) && ((mi * i) + (ma * j)) <= u){ forn(k, 0, i) r.pb(mint[k]); forn(k, 0, j) r.pb(maxs[k]); return r; } } } 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...