Submission #138805

# Submission time Handle Problem Language Result Execution time Memory
138805 2019-07-30T10:49:47 Z PedroBigMan Detecting Molecules (IOI16_molecules) C++14
Compilation error
0 ms 0 KB
#include "molecules.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define INF ((ll) pow(2,63) -1)
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<int> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}

std::vector<int> find_subset(int l, int u, std::vector<int> w) 
{
    ll we=w[0]; ll n = w.size();
    ll lo = (ll) ceil((ld) (l)/(ld) (we));
    ll hi = (ll) floor((ld) (u)/(ld) (we));
    vector<int> ans;
    if(lo<=hi && lo<=n) {REP(i,0,lo) {ans.pb((int) i);}}
    return ans;
}

int main()
{
    ll n,l,u; cin>>n>>l>>u; vector<int> q; In(q,n);
    Out(find_subset(l,u,q));
    return 0;
}

Compilation message

molecules.cpp: In function 'void Out(std::vector<int>)':
molecules.cpp:11:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,a,b) for(ll i=a; i<b; i++)
molecules.cpp:20:30:
 void Out(vector<int> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                              ~~~~~~~~~~~~
molecules.cpp:20:26: note: in expansion of macro 'REP'
 void Out(vector<int> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                          ^~~
/tmp/ccatsoYQ.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cclNpyPQ.o:molecules.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status