제출 #764988

#제출 시각아이디문제언어결과실행 시간메모리
764988fatemetmhr로봇 (IOI13_robots)C++17
14 / 100
138 ms5492 KiB
// ~ Be Name Khoda ~ // #include "robots.h" #include <bits/stdc++.h> //#pragma GCC optimize ("O3") //#pragma GCC target("avx2") //#pragma GCC optimize("unroll-loops,Ofast") using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fi first #define se second const int maxn = 1e6 + 10; const int maxn5 = 5e5 + 10; const int maxnt = 1.2e6 + 10; const int maxn3 = 1e3 + 10; const int mod = 1e9 + 7; const ll inf = 1e18; bool mark[maxn5]; int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) { sort(w, w + t); sort(x, x + a); int ans = 0, rem = t; //cout << w[t - 1] << ' ' << x[a - 1] << endl; if(w[t - 1] >= x[a - 1]) return -1; while(rem){ int ind = a - 1; ans++; for(int i = t - 1; i >= 0; i--) if(!mark[i] && ind >= 0 && x[ind] > w[i]){ mark[i] = true; ind--; rem--; } } 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...