Submission #57705

# Submission time Handle Problem Language Result Execution time Memory
57705 2018-07-15T21:16:47 Z Benq Martian DNA (IOI16_dna) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

string des = "011100101011101";

/*bool make_test(string s) {
    F0R(i,sz(des)-sz(s)+1) if (des.substr(0,sz(s)) == s) return 1;
    return 0;
}*/

string analyse(int n, int t) {
    string cur = "";
    while (1) {
        if (make_test(cur+"1")) cur += "1";
        else if (make_test(cur+"0")) cur += "0";
        else break;
    }
    while (sz(cur) < n) {
        if (make_test("1"+cur)) cur = "1"+cur;
        else cur = "0"+cur;
    }
    return cur;
}

Compilation message

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:54:13: error: 'make_test' was not declared in this scope
         if (make_test(cur+"1")) cur += "1";
             ^~~~~~~~~
dna.cpp:54:13: note: suggested alternative: 'makedev'
         if (make_test(cur+"1")) cur += "1";
             ^~~~~~~~~
             makedev
dna.cpp:59:13: error: 'make_test' was not declared in this scope
         if (make_test("1"+cur)) cur = "1"+cur;
             ^~~~~~~~~
dna.cpp:59:13: note: suggested alternative: 'makedev'
         if (make_test("1"+cur)) cur = "1"+cur;
             ^~~~~~~~~
             makedev
grader.cpp: In function 'bool make_test(std::__cxx11::string)':
grader.cpp:14:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < p.size(); i++) {
                  ~~^~~~~~~~~~
grader.cpp:23:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i <= ss.size(); i++) {
                  ~~^~~~~~~~~~~~
grader.cpp:28:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (pr[i] == p.size()) {