Submission #67144

# Submission time Handle Problem Language Result Execution time Memory
67144 2018-08-13T11:49:03 Z MrTEK Hidden Sequence (info1cup18_hidden) C++14
0 / 100
11 ms 688 KB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;
#define mp make_pair
#define pb push_back
#define len(a) (int)a.size()
#define fi first
#define sc second
#define d1(w) cerr<<#w<<":"<<w<<endl;
#define d2(w,c) cerr<<#w<<":"<<w<<" "<<#c<<":"<<c<<endl;
#define d3(w,c,z) cerr<<#w<<":"<<w<<" "<<#c<<":"<<c<<" "<<#z<<":"<<z<<endl;
#define left ind+ind
#define right ind+ind+1
#define mid (l+r)/2
#define FAST_IO ios_base::sync_with_stdio(false);
#define endl '\n'

const int maxn = 620;
const long long LINF = 1e18;
const int LOG = 31;
const int INF = 1e9;
const int N = 1e3 + 5;
const int M = 4;
const int SQ = 350;
const int MOD = 998244353;

vector < int > findSequence (int N)
{
    vector < int > ans (N, 0),sif,v;
    for (int i = 0 ; i < N ; i++) {
        sif.pb(0);
        if (isSubsequence(sif) == false) {sif.pop_back();break;}
    }
    if (len(sif) == N) {
        for (int i = 0 ; i < N ; i++) ans[i] = sif[i];
        return ans;
    }
    for (int i = 0 ; i < N ; i++) {
        v.clear();
        for (int j = 0; j < i ; j++) v.pb(ans[j]);
        v.pb(1);
        for (int j = 0 ; j < len(sif) ; j++) v.pb(sif[j]);
        if (isSubsequence(v)) {
            ans[i] = 1;
            continue;
        }
        else {
            ans[i] = 0;
            sif.pop_back();
        }
    }
    return ans;
}

Compilation message

grader.cpp: In function 'int main()':
grader.cpp:28:43: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
     fprintf (fifo_out, "%d\n", ans.size ());
                                ~~~~~~~~~~~^
grader.cpp:29:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<ans.size () && i < N; i++)
                   ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 248 KB Output is partially correct: Maximum length of a query = 8
2 Runtime error 4 ms 564 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 8 ms 568 KB Output is partially correct: Maximum length of a query = 165
2 Partially correct 8 ms 568 KB Output is partially correct: Maximum length of a query = 178
3 Partially correct 8 ms 604 KB Output is partially correct: Maximum length of a query = 190
4 Partially correct 5 ms 672 KB Output is partially correct: Maximum length of a query = 153
5 Runtime error 11 ms 688 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -