当前位置:网站首页>Luogu_ P1149 [noip2008 improvement group] matchstick equation_ Enumeration and tabulation
Luogu_ P1149 [noip2008 improvement group] matchstick equation_ Enumeration and tabulation
2022-07-03 00:13:00 【This question AC sleep again】
Luogu _P1149 [NOIP2008 Improvement group ] The matchstick equation _ Enumeration and tabulation


// The meter
#include<bits/stdc++.h>
using namespace std;
const int N=99999;
// 0 1 2 3 4 5 6 7 8 9 10 11 12
int mp[N]={ 6,2,5,5,4,5,6,3,7,6, 8,4,7 };
void init()
{
int i,t,sum;
for( i=10;i<N;i++ )
{
t=i; sum=0;
while( t ) { sum+=mp[t%10]; t/=10; }
mp[i]=sum;
}
}
int main()
{
init();
int n,i,j,k,sum,ans;
while( cin>>n )
{
for( k=0;k<=24;k++ )
{
ans=0; // pos
for( i=0;i<N/2;i++ )
for( j=0;j<N/2;j++ )
{
sum=mp[i]+mp[j]+mp[i+j]+4;
if( sum==k ) ans++;
}
cout<<ans<<" ";
}
}
return 0;
}
// Add comma
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while( cin>>n )
{
cout<<n<<",";
}
return 0;
}
//
#include<bits/stdc++.h>
using namespace std;
const int ans[]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,8,9,6,9,29,39,38,65,88,128 };
int main()
{
int n;
while( cin>>n )
{
cout<<ans[n]<<endl;
}
return 0;
}边栏推荐
- Request and response
- 【OJ】两个数组的交集(set、哈希映射 ...)
- How to specify const array in the global scope of rust- How to specify const array in global scope in Rust?
- 接口自动化覆盖率统计——Jacoco使用
- Matlab 信号处理【问答笔记-1】
- What are the projects of metauniverse and what are the companies of metauniverse
- Digital twin visualization solution digital twin visualization 3D platform
- Bean load control
- Container runtime analysis
- 经济学外文文献在哪查?
猜你喜欢

TypeError: Cannot read properties of undefined (reading ***)

CADD课程学习(4)-- 获取没有晶体结构的蛋白(SWISS-Model)

直击产业落地!飞桨重磅推出业界首个模型选型工具

来自数砖大佬的 130页 PPT 深入介绍 Apache Spark 3.2 & 3.3 新功能

MySQL Foundation

Load balancing cluster (LBC)

Architecture: load balancing

Talk with the interviewer about the pit of MySQL sorting (including: duplicate data problem in order by limit page)

130 pages of PPT from the brick boss introduces the new features of Apache spark 3.2 & 3.3 in depth

Angled detection frame | calibrated depth feature for target detection (with implementation source code)
随机推荐
Open source | Wenxin big model Ernie tiny lightweight technology, which is accurate and fast, and the effect is fully open
Chinatelecom has maintained a strong momentum in the mobile phone user market, but China Mobile has opened a new track
Speech recognition Series 1: speech recognition overview
返回二叉树中最大的二叉搜索子树的大小
[array] binary search
The privatization deployment of SaaS services is the most efficient | cloud efficiency engineer points north
In February 2022, the ranking list of domestic databases: oceanbase regained its popularity with "three consecutive increases", and gaussdb is expected to achieve the largest increase this month
论文的英文文献在哪找(除了知网)?
英文论文有具体的格式吗?
Installing redis under Linux
95页智慧教育解决方案2022
67页新型智慧城市整体规划建设方案(附下载)
Mutual exclusion and synchronization of threads
Talk with the interviewer about the pit of MySQL sorting (including: duplicate data problem in order by limit page)
JSON data transfer parameters
cocospods 的使用
MySQL Foundation
Develop knowledge points
ArrayList analysis 2: pits in ITR, listiterator, and sublist
Optimization of streaming media technology