Submission #821407

#TimeUsernameProblemLanguageResultExecution timeMemory
821407andecaandeciRobots (IOI13_robots)C++17
Compilation error
0 ms0 KiB
#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; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccCubtOZ.o: in function `main':
robots.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccO1YwEZ.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccO1YwEZ.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status