Apocalypse Someday Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 1807 Accepted: 873 Description The number 666 is considered to be the occult “number of the beast” and is a well used number in all major apocalypse themed blockbuster…
数位DP加二分 //数位dp,dfs记忆化搜索 #include<iostream> #include<cstdio> #include<cstring> using namespace std; typedef long long LL; #define N 20 LL dp[N][3];//dp[i][j]表示长度为i,前面有j个6时不含666的数的个数 int num[N]; //c6表示前面6的个数 LL dfs(int len, int c6, bool is…
题意 Language:Default Apocalypse Someday Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 2499 Accepted: 1288 Description The number 666 is considered to be the occult "number of the beast" and is a well used number in all major apocaly…
All submissions for this problem are available. Chef likes numbers and number theory, we all know that. There are N digit strings that he particularly likes. He likes them so much that he defines some numbers to be beautiful numbers based on these di…