Submission #1141543

#TimeUsernameProblemLanguageResultExecution timeMemory
1141543AgageldiHidden Sequence (info1cup18_hidden)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "grader.cpp"
#include "grader.h"

using namespace std;
vector <int> v;
int n, m, a[500];
void solve(int x,int N) {
	if((int)v.size()) return;
	if(x == N+1) {
		vector <int> ans;
		for(int i=1;i<=N;i++) {
			ans.push_back(a[i]);
		}
		bool answer = isSubsequence(ans);
		if(answer) v = ans;
		return;
	}
	for(int i = 0;i<= 1;i++) {
		a[x] = i;
		solve(x + 1, N);
	}
}

vector < int > findSequence (int N)
{
	solve(1,N);
	return v;
}

Compilation message (stderr)

In file included from hidden.cpp:2:
grader.cpp: In function 'int main()':
grader.cpp:28:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   28 |     fprintf (fifo_out, "%d\n", ans.size ());
      |                         ~^     ~~~~~~~~~~~
      |                          |              |
      |                          int            std::vector<int>::size_type {aka long unsigned int}
      |                         %ld
grader.cpp: In function 'int main()':
grader.cpp:28:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   28 |     fprintf (fifo_out, "%d\n", ans.size ());
      |                         ~^     ~~~~~~~~~~~
      |                          |              |
      |                          int            std::vector<int>::size_type {aka long unsigned int}
      |                         %ld
/usr/bin/ld: /tmp/ccZx8Q2v.o: in function `isSubsequence(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x0): multiple definition of `isSubsequence(std::vector<int, std::allocator<int> >)'; /tmp/ccvFIyx6.o:hidden.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccZx8Q2v.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvFIyx6.o:hidden.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status