题意:给出一个字符串,包含0.1.*,当中×是能够替换成0或者1的,假设字符串的某个子串S有SSS这种连续反复3次出现,不是Triple-free串,问给出的字符串能够形成多少个非Triple-free串. 题解:由于串长度最多31,所以能够暴力枚举每一位,边枚举边推断. #include <stdio.h> #include <string.h> const int N = 35; char str[N], str2[N]; int n; long long res; bool…
Roman Numerals The original system of writing numbers used by the early Romans was simple but cumbersome. Various letters were used to represent important numbers, and these were then strung together to represent other numbers with the values decr…
A - Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Su Description Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the first number divide…
题意:给一个n长度的整数,删掉 k 个数字,使得剩下的数字最大. 分析:还剩 n-k 个数字,就是在原序列里面,相对顺序不变的情况下,这个n-k个数字组成的数最大. 感觉没有什么特别好的方法策略,看了一下方案,策略是: 不断的调整这n-k个数字,感觉这个时间复杂度受不了,哈哈~~~ 如何调整:当我确定的 K 个数字 + 还剩下的 n - i 个数字 > n - k ,那么这里就会有调整,调整到恰好 >= c 的位置处. #include <bits/stdc++.h> using…