Submission #138803

# Submission time Handle Problem Language Result Execution time Memory
138803 2019-07-30T10:47:55 Z PedroBigMan Detecting Molecules (IOI16_molecules) C++14
0 / 100
2 ms 376 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) we);} return ans;}
    return vector<int>(0);
}

/*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;}
                          ^~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 252 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 252 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 252 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 252 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 252 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -