/*********************************
* 日期:2011-3-10
* 作者:SJF
* 题号:杭电1097
* 题目:A hard puzzle
* 结果:AC
* 题意:
* 总结:DP问题
挺有规律的!!!!
输入的最后一位是:0 digit_number:0
1 1
2 2 4 8 6
..............
9 9 1
**********************************/
#include<stdio.h>
int main()
{
__int64 a,b,c;
int digit_number[11][6]={{1,0},{1,1},{4,2,4,8,6},{4,3,9,7,1},{2,4,6},{1,5},{1,6},{4,7,9,3,1},{4,8,4,2,6},{2,9,1}};
while(scanf("%I64d %I64d",&a,&b)!=EOF)
{
c=b%digit_number[a%10][0];
if(c==0)
{
c=digit_number[a%10][0];
}
printf("%I64d\n",digit_number[a%10][c]);
}
return 0;
}
分享到:
相关推荐
puzzle gameelectronjs
A fully automated greedy square jigsaw puzzle solver
Dealing with Eight Puzzle searching problem by using A star algorithm with C++ language.
人工智能作业:实现一个A-star搜索算法来解决15-puzzle问题
For 8-puzzle solver and path finder
A python program solving an 8 puzzle game with BFS.
Java PUZZLE Java 解惑 Java PUZZLE Java 解惑 Java PUZZLE Java 解惑Java PUZZLE Java 解惑 Java PUZZLE Java 解惑 Java PUZZLE Java 解惑
Rekindle your mathematical mind to design perfectly interlocking complex pieces of a puzzle Personalize the puzzle's design with a photo or shape of your own choice Book Description Jigsaw puzzles ...
the algorithm of game 8 puzzle
NPuzzle求解研究报告.docx
An 4x4 picture puzzle game with C# windows application
用Qt(C++)编写的15puzzle与8puzzle游戏.zip用Qt(C++)编写的15puzzle与8puzzle游戏.zip用Qt(C++)编写的15puzzle与8puzzle游戏.zip用Qt(C++)编写的15puzzle与8puzzle游戏.zip用Qt(C++)编写的15puzzle与8...
Flash based crossword puzzle generater, output format: XML
A*算法解决8数码难题,有界面。 A*算法解决8数码难题,有界面。
Dots and Lines Puzzle!Dots and Lines Puzzle!Dots and Lines Puzzle!
关于puzzle例题的原题资源,搭配文章使用更配噢 https://editor.csdn.net/md/?articleId=124139016
8 puzzle问题, C# 代码,算法设计与分析课程作业,实现简单的8 puzzle游戏,适合初学者
Jigsaw Puzzle Pack is a scripted Jigsaw Puzzle pack with C# + JS Javascript support. Use it to create in-game puzzles.225 unique modeled 'tiling' pieces. Automatic, puzzlesize related, puzzle piece ...
The Puzzle of Thought Experiments in Conceptual
The C Puzzle Book