제출 #367646

#제출 시각아이디문제언어결과실행 시간메모리
367646idk321로봇 (IOI13_robots)C++11
0 / 100
1 ms492 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) { vector<array<int, 2>> toys(t); for (int i = 0; i < t; i++) { toys[i][0] = w[i]; toys[i][1] = s[i]; } int res = 0; set<int> sett; for (int i = 0; i < t; i++) sett.insert(w[i]); sort(x, x + a); if (*sett.rbegin() >= x[a - 1]) return -1; while (!sett.empty()) { for (int i = a - 1; i >= 0; i--) { auto it = sett.lower_bound(x[i]); if (it == sett.begin()) break; sett.erase(it); } res++; } return res; }
#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...