当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2305:Basic remains

题目描述
Given a base b and two non-negative base b integers p and m, compute p mod m and print the result as a base b integer. p mod m is defined as the smallest non-negative integer k such that p = a*m + k for some integer a.
输入解释
Input consists of a number of cases. Each case is represented by a line containing three unsigned integers. The first, b, is a decimal number between 2 and 10. The second, p, contains up to 1000 digits between 0 and b-1. The third, m, contains up to 9 digits between 0 and b-1. The last case is followed by a line containing 0.
输出解释
For each test case, print a line giving p mod m as a base-b integer.
输入样例
2 1100 101
10 123456789123456789123456789 1000
0
输出样例
10
789

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2305

最后修改于 2020-10-29T06:29:16+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536