제출 #482907

#제출 시각아이디문제언어결과실행 시간메모리
482907MohamedAliSaidane로봇 (IOI13_robots)C++14
0 / 100
117 ms15276 KiB
#include <bits/stdc++.h>
#include "robots.h"
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> ti;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ld,ld> pld;
#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front
#define ff first
#define ss second
#define MOD (ll)(1000000007)
#define INF (ll) (1e18)
#define all(v) (v).begin(),(v).end()
const int nx[8] = {0, 0, 1, -1,1,1,-1,-1}, ny[8] = {1, -1, 0, 0,1,-1,1,-1}; //East, West, South, North+
ll gcd(ll a , ll b) {return b ? gcd(b , a % b) : a ;}
ll lcm(ll a, ll b){return (a / gcd(a, b)) * b;}
////////////******SOLUTION******\\\\\\\\\\\

int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[])
{
    int wmax = 0;
    int smax = 0;
    for(int i = 0; i < A; i ++)
        wmax = max(wmax,X[i]);
    for(int i = 0; i < B; i ++)
        smax = max(smax,Y[i]);
    for(int i = 0; i < T; i ++)
        if(W[i] >= wmax && S[i] >= smax)
            return - 1;
    // subtask 1
    if(T == 2 && A+B == 2)
    {
        if(A == 2)
        {
            if(min(X[0],X[1]) > min(W[0],W[1]) && max(X[0],X[1]) > max(W[0],W[1]))
                return 1;
        }
        else if(B == 2)
        {
            if(min(Y[0],Y[1]) > min(S[0],S[1]) && max(Y[0],Y[1]) > max(S[0],S[1]))
                return 1;
        }
        else
        {
            if((X[0] > W[0] && Y[1] > S[1]) || (X[0] > W[1] && Y[1] > S[0]))
                return 1;
        }
        return 2;
    }
    return 1;

}

/*int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int A, B, T;
    cin >> A >> B >> T;
    int X[A], Y[B], W[T], S[T];
    for(int i = 0; i < A; i ++)
    {
        int x; cin >> x;
        X[i]=x;
    }
    for(int i = 0; i< B; i ++)
    {
        int y; cin >> y;
        Y[i]=y;
    }
    for(int i = 0;  i < T; i ++)
    {
        int w, s;
        cin >> w >> s;
        W[i] = w;
        S[i] = s;
    }
    cout << putaway(A,B,T,X,Y,W,S) << '\n';
}*/
/*

*/

컴파일 시 표준 에러 (stderr) 메시지

robots.cpp:25:1: warning: multi-line comment [-Wcomment]
   25 | ////////////******SOLUTION******\\\\\\\\\\\
      | ^
#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...