CodeforcesRound#283(Div.2)--B.SecretCombination_html/css_WEB-ITnose
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CodeforcesRound#283(Div.2)--B.SecretCombination_html/css_WEB-ITnose,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2783字,纯文字阅读大概需要4分钟。
内容图文
B. Secret Combination
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
You got a box with a combination lock. The lock has a display showing n digits. There are two buttons on the box, each button changes digits on the display. You have quickly discovered that the first button adds 1 to all the digits (all digits 9 become digits 0), and the second button shifts all the digits on the display one position to the right (the last digit becomes the first one). For example, if the display is currently showing number 579, then if we push the first button, the display will show 680, and if after that we push the second button, the display will show 068.
You know that the lock will open if the display is showing the smallest possible number that can be obtained by pushing the buttons in some order. The leading zeros are ignored while comparing numbers. Now your task is to find the desired number.
Input
The first line contains a single integer n (1?≤?n?≤?1000) ? the number of digits on the display.
The second line contains n digits ? the initial state of the display.
Output
Print a single line containing n digits ? the desired state of the display containing the smallest possible number.
水题,把环展开成链,而且最多加9次,所以暴力就行
#include
内容总结
以上是互联网集市为您收集整理的CodeforcesRound#283(Div.2)--B.SecretCombination_html/css_WEB-ITnose全部内容,希望文章能够帮你解决CodeforcesRound#283(Div.2)--B.SecretCombination_html/css_WEB-ITnose所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。