diff --git a/01xxx/01086.cpp b/01xxx/01086.cpp new file mode 100644 index 00000000..af7afd7c --- /dev/null +++ b/01xxx/01086.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +using namespace std; + +long long gcd(long long a, long long b) { + return b ? gcd(b, a % b) : a; +} + +void solve(void) { + int n; cin >> n; + vector s(n); + for (int i=0; i> s[i]; + int k; cin >> k; + + vector a(n, 0); + for (int i=0; i ten(55, 1 % k); + for (int i=1; i<55; i++) { + ten[i] = (10 * ten[i-1]) % k; + } + + vector> dp(1<(k, 0)); + dp[0][0] = 1; + for (int mask=0; mask<(1<