[NOIP2008] 火柴棒等式
来源:互联网 发布:什么是数据生态圈 编辑:程序博客网 时间:2024/06/11 03:47
题目:https://www.hrbustacm.com/web/problem.php?id=1360
代码:
#include<stdio.h>#include<string.h>#include<iostream>using namespace std;int maps[11]= {6,2,5,5,4,5,6,3,7,6};int rt[11112];int judge(int k){ int ans=0; if(k==0) return 6; while(k) { ans=ans+maps[k%10]; k=k/10; } return ans;}int main(){ for(int i=0; i<=1000; i++) rt[i]=judge(i); int n; while(~scanf("%d",&n)) { if(n<13) { printf("0\n"); continue ; } n=n-4; int temp=0; for(int i=0; i<=1000; i++) { for(int j=0; j<=1000; j++) { if(rt[i]+rt[j]+rt[i+j]==n&&rt[i+j]!=0) { //printf("%d %d %d\n",rt[i],rt[j],rt[i+j]); //printf("%d %d %d\n",i,j,i+j); temp++; } } } printf("%d\n",temp); }}/*24 23 221128 88 65*/
0 0
- [NOIP2008]火柴棒等式
- [NOIP2008] 火柴棒等式
- NOIP2008 火柴棒等式
- noip2008火柴棒等式
- NOIP2008 火柴棒等式
- [NOIP2008] 火柴棒等式
- NOIP2008 火柴棒等式
- NOIp2008 火柴棒等式
- 【枚举】[NOIP2008]火柴棒等式
- noip2008 火柴棒等式 (暴力枚举)
- |洛谷|搜索|NOIP2008|P1149 火柴棒等式
- 【NOIP2008】T2 火柴棒等式 题解
- 【提高组NOIP2008】火柴棒等式
- [noip模拟]四道题 noip2008 笨小猴 noip2008 火柴棒等式 noip2008 双栈排序 noip2008 传纸条
- noip2008提高组——火柴棒等式
- [NOIP2008]笨小猴,火柴棒等式,传纸条,双栈排序
- NOIP2008 笨小猴 火柴棒等式 传纸条 双栈排序
- 火柴棒等式(洛谷 1149 && NOIp2008 提高组 T2 )
- LINUX和UNIX的关系是什么?
- C#匿名方法和lambda
- hdu1077 catching fish
- ps魔棒工具使用
- Sum to N--DFS
- [NOIP2008] 火柴棒等式
- Java多线程
- 试用CNTK
- Java中的continue、break和return
- activemq中的订阅模式以及消息时长和确认机制
- scala学习之路:9.Override重写字段或者方法
- eclipse 显示setting目录
- iOS日历中给一个事件添加多个提醒
- java线程传统VS现代【2】