Submission #1254726


Source Code Expand

#include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define print(x) cout<<x<<endl;
typedef long long ll;

int n, m;
int a[30], b[30];
bool exist = 0;
int cnt = 0;
bool check(bool flag[8]) {
	int c = 0;
	rep(i, 0, n) {
		if (flag[i] == 1)c += 1;
	}
	if (c == n)return 1;
	return 0;
}

bool is(int now, bool flag[8]) {
	int next[8] = { -1,-1,-1,-1,-1,-1,-1,-1, };
	flag[now] = 1;
	if (check(flag))return 1;
	rep(i, 0, m) {
		if (a[i] == now)next[i] = b[i];
		if (b[i] == now)next[i] = a[i];
	}
	rep(i, 0, m) {
		if (next[i] != -1 && flag[next[i]] == 0) { exist = is(next[i], flag); }
		if (exist)cnt += 1; return 1;
		flag[next[i]] = 0;
	}
	return 0;
}

Submission Info

Submission Time
Task C - One-stroke Path
User ttakano
Language C++14 (GCC 5.4.1)
Score 0
Code Size 744 Byte
Status CE

Compile Error

/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol ...