# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
714521 | 2023-03-24T21:29:50 Z | mseebacher | 로봇 (IOI13_robots) | C++17 | 691 ms | 37748 KB |
#include <bits/stdc++.h> using namespace std; #include "robots.h" typedef long long ll; typedef vector<int> vi; #define MAXI (int)1e5 #define pb(x) push_back(x) vector<int> ad[MAXI]; vector<bool> vis(MAXI,0); void dfs(int x){ if(vis[x]) return; vis[x] = 1; for(auto s:ad[x]){ dfs(s); } } void setIO(string s) { freopen((s + ".in").c_str(), "r", stdin); freopen((s + ".out").c_str(), "w", stdout); } int putaway(int A,int B,int T, int X[],int Y[],int W[],int S[]){ sort(X,X+A); sort(W,W+T); if(W[T-1] >= X[A-1]) return -1; multiset<int> se; for(int i = 0;i<T;i++) se.insert(W[i]); multiset<int> av; int time = 0; multiset<int>::reverse_iterator it; while(!se.empty()){ ++time; for(int i = 0;i<A;i++) av.insert(X[i]); vector<int> loe; for(it = se.rbegin();it != se.rend();it++){ if(av.size() == 0) break; if(*av.rbegin() > *it){ av.erase(av.find(*av.rbegin())); loe.push_back(*it); } } for(int i = 0;i<(int)loe.size();i++){ se.erase(se.find(loe[i])); } } return time; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2644 KB | Output is correct |
2 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2644 KB | Output is correct |
2 | Correct | 1 ms | 2644 KB | Output is correct |
3 | Correct | 1 ms | 2644 KB | Output is correct |
4 | Correct | 548 ms | 32580 KB | Output is correct |
5 | Correct | 170 ms | 11588 KB | Output is correct |
6 | Correct | 56 ms | 9036 KB | Output is correct |
7 | Correct | 558 ms | 37748 KB | Output is correct |
8 | Correct | 691 ms | 37228 KB | Output is correct |
9 | Correct | 440 ms | 37588 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |