Submission #1008737

#TimeUsernameProblemLanguageResultExecution timeMemory
1008737c2zi6Robots (IOI13_robots)C++14
0 / 100
1 ms348 KiB
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define all(a) (a).begin(), (a).end() #define replr(i, a, b) for (int i = int(a); i <= int(b); ++i) #define reprl(i, a, b) for (int i = int(a); i >= int(b); --i) #define rep(i, n) for (int i = 0; i < int(n); ++i) #define mkp(a, b) make_pair(a, b) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<PII> VPI; typedef vector<VI> VVI; typedef vector<VVI> VVVI; typedef vector<VPI> VVPI; typedef pair<ll, ll> PLL; typedef vector<ll> VL; typedef vector<PLL> VPL; typedef vector<VL> VVL; typedef vector<VVL> VVVL; typedef vector<VPL> VVPL; template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;} template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;} #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<class T> using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #include "robots.h" namespace TEST1 { int solve(int A, int B, int T, int X[], int Y[], int W[], int S[]) { if (A == 2) { VI x{X[0], X[1]}; VI w{W[0], W[1]}; sort(all(x)); sort(all(w)); if (w[0] <= x[0] && w[1] <= x[1]) return 1; if (w[1] <= x[1]) return 2; return -1; } if (B == 2) { VI y{Y[0], Y[1]}; VI s{S[0], S[1]}; sort(all(y)); sort(all(s)); if (s[0] <= y[0] && s[1] <= y[1]) return 1; if (s[1] <= y[1]) return 2; return -1; } int x = X[0]; int y = Y[0]; if (W[0] <= x && S[1] <= y) return 1; if (W[1] <= x && S[0] <= y) return 1; if (W[0] <= x && W[1] <= x) return 2; if (S[0] <= y && S[1] <= y) return 2; return -1; } }; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { if (A + B == 2 && T == 2) return TEST1::solve(A, B, T, X, Y, W, S); return -1; }
#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...