Submission #993321

#TimeUsernameProblemLanguageResultExecution timeMemory
993321vjudge1Robots (IOI13_robots)C++17
0 / 100
0 ms348 KiB
#include "robots.h" #include <bits/stdc++.h> #define ll long long #define endl '\n' //#define f first //#define s second using namespace std; int putaway(int a , int b , int t , int x[] , int y[] , int w[] , int s[]) { a = 3; x[0] = 1; x[1] = 2; x[2] = 3; t = 3; w[0] = 0; w[1] = 1; w[2] = 2; //cout << x[2] << endl; vector<int> v; for (int i=0; t>i; i++) { v.push_back(w[i]); } sort(v.begin() , v.end()); sort(x , x + a); int ans = 0; while (!v.empty()) { bool f = 0; int j = a - 1; for (int i=v.size()-1; i>=0; i--) { //cout << i << endl; if (x[j] > v[i]) { //cout << v[2] << " " << x[2] << endl; v.pop_back(); f = 1; j--; } } ans++; if (f == 0) { ans = -1; break; } } 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...