제출 #538885

#제출 시각아이디문제언어결과실행 시간메모리
538885beaconmcDetecting Molecules (IOI16_molecules)C++14
0 / 100
0 ms212 KiB
/* .'.................',. ............'''',,'''',,'.. ......''';:cloodxxxxdolc;,''.. ......',;,:lddxkkOO000Okkxdc,.... .....';;;;:ldddxkkOO0K0Okkkxdc,... ....';::;:ldddxxkkkO000Okkkxdo:.... ...';;;:codddddxxxkkOO00Okkxxo:'... ██████╗ ███████╗ █████╗ ██████╗ ██████╗ ███╗ ██╗ ...';,,:cloooooddddddxxxddddddc'... ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔═══██╗████╗ ██║ ..',,,'',;;:cclollcc;,''',;coo;.. ██████╔╝█████╗ ███████║██║ ██║ ██║██╔██╗ ██║ ..,,,''....',:oddl:,'..',,,:od:.'. ██╔══██╗██╔══╝ ██╔══██║██║ ██║ ██║██║╚██╗██║ ..';;'','....'cdkOx:'',,;clclodc,:, ██████╔╝███████╗██║ ██║╚██████╗╚██████╔╝██║ ╚████║ ..';;,,,,',,',cdkkxolccccloddooc;:; ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ .';::cllc::,,cdxxdooollloddxxdlcoc. ________ ___ .';:clc:;;;,;codddooolc::cclooodkc. ███████╗██╗ ██╗███████╗███████╗██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗ /_ __/ |/ / .';;;,,,,,,,;cooollloolc;,',:cc:,. ██╔════╝██║ ██║██╔════╝██╔════╝╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ / / / /|_/ / .,,,'..',,,,,::::cccc:;''..;:,. ███████╗██║ ██║███████╗███████╗ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ /_/ /_/ /_/ ';:;,..,;;;,;:ccllool;';;;::. ╚════██║██║ ██║╚════██║╚════██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ .,:::,';oxxxxkkO00KOocclcc:. ███████║╚██████╔╝███████║███████║ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗ .';::,',coxxkkkkxxo:cool;. ╚══════╝ ╚═════╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ .,:;,'',:cccllodolodo:. ..''',;;;;::cllooooodddocc:;,.. ....'',;;'''',;::cclllloddddlclolcdxdl:,.. ..'',,'',;,,;;,,''';:ccloloodddol:::llldkkkkxxdl;. :,,,;,',;;,,;,'',,,,,:clooooool::clc:coxxxkkkkkkkx ''',,,',;;,,,'.',,,,'';:cccc:;,;cloollodxxkkkkkkkk */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include "molecules.h" typedef long long ll; using namespace std; using namespace __gnu_pbds; #define FOR(i, x, y) for(int i=x; i<y; i++) #define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL) vector<int> find_subset(int l, int u, vector<int> w){ set<vector<int>> sus; int n = w.size(); vector<int> ans; FOR(i,0,n){ if (l<=w[i] && w[i] <= u){ ans.push_back(i+1); return ans; } } int cur = 0; FOR(i,0,n){ cur += w[i]; if (sus.size() != 0){ auto it = sus.lower_bound({cur-u, -1}); auto it2 = sus.lower_bound({cur-l, 1000000}); it2--; if (it != sus.end() && it2 != sus.end() && (*it)[0] >= (*it2)[0]){ ans = {(*it)[1]+2, (*it2)[1]+1}; return ans; } } sus.insert({cur, i}); } return ans; }
#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...