Submission #482906

#TimeUsernameProblemLanguageResultExecution timeMemory
482906MohamedAliSaidaneRobots (IOI13_robots)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.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'; } /* */

Compilation message (stderr)

robots.cpp:24:1: warning: multi-line comment [-Wcomment]
   24 | ////////////******SOLUTION******\\\\\\\\\\\
      | ^
/usr/bin/ld: /tmp/ccFayn7b.o: in function `main':
robots.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccjspIxc.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccjspIxc.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status