Submission #781110

#TimeUsernameProblemLanguageResultExecution timeMemory
781110tolbiRobots (IOI13_robots)C++17
0 / 100
0 ms340 KiB
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor #define author tolbi #include<bits/stdc++.h> using namespace std; template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr){return os<<pr.first<<" "<<pr.second;} template<typename X> ostream& operator<<(ostream& os, vector<X> v){for (auto &it : v) os<<it; return os;} template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> v){for (auto &it : v) os<<it; return os;} #define endl '\n' #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define vint(x) vector<int> x #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define tol(bi) (1LL<<((long long)(bi))) #define coutarr(x) for (auto &it : x) cout<<it<<endl; typedef long long ll; const ll INF = LONG_LONG_MAX; const int MOD = 1e9+7; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include "robots.h" int putaway(int n, int m, int t, int X[], int Y[], int W[], int S[]) { if (n==0){ swap(n,m); swap(X,Y); swap(S,W); } vector<int> x(n); for (int i = 0; i < n; ++i) { x[i]=X[i]; } sortarr(x); vector<int> say(n); for (int i = 0; i < t; ++i) { if (lower_bound(x.begin(), x.end(), W[i]+1)==x.end()) return -1; say[lower_bound(x.begin(), x.end(), W[i]+1)-x.begin()]++; } int ans = MOD; for (int i = n-1; i >= 0; i--){ if (i<n-1) say[i]+=say[i+1]; ans=min(ans,(say[i]+(n-i)-1)/(n-i)); } return ans; }

Compilation message (stderr)

robots.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
#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...