# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
821407 | andecaandeci | Robots (IOI13_robots) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define longlonginf LONG_LONG_MAX
#define inf INT_MAX
using namespace std;
ll n,m;
ll l,r;
string s;
//x = weight limit
//y = size limit
//{weight,size}
bool can(pair<int,int> x,pair<int,int> y){
if( x.first == 0 ){
if( y.first < x.second ) return 1;
}
else{
if( y.second < x.second ) return 1;
}
return 0;
}
int putaway(int a,int b,int t,int x[],int y[],int w[],int s[]){
//convert to a single array
vector<pair<int,int>> v;
for(int i = 0 ; i < a ; i++ ) v.push_back({0,x[i]});
for(int i = 0 ; i < b ; i++ ) v.push_back({1,y[i]});
vector<pair<int,int>> toys;
for(int i = 0 ; i < t ; i++){
toys.push_back({w[i],s[i]});
}
if( t == 2 && a+b == 2 ){
ll ans = inf;
if( can(v[0],toys[0]) && can(v[0],toys[1]) ) ans = min(ans,(ll)2);
if( can(v[1],toys[0]) && can(v[1],toys[1]) ) ans = min(ans,(ll)2);
if( can(v[0],toys[0]) && can(v[1],toys[1]) ) ans = min(ans,(ll)1);
if( can(v[1],toys[0]) && can(v[0],toys[1]) ) ans = min(ans,(ll)1);
if( ans == inf) return -1;
else return ans;
}
return 0;
}
int main(){
int T = 1;
//cin>>T;
for(int i = 1 ; i <= T ; i++){
//~ solve();
}
return 0;
}