摘要: 求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方” 思路:后三位只跟后三位相乘有关,所以可以每乘一次都对1000取余。 代码: #include <stdio.h>#include <stdlib.h> int main(){ int result,i,m,n; while(scan 阅读全文
posted @ 2017-08-24 21:56 北梗 阅读(72) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given a positive integer N, you should output the most right digit of N^N. Input The input contains several test cases. The first 阅读全文
posted @ 2017-08-24 20:40 北梗 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order 阅读全文
posted @ 2017-08-24 16:57 北梗 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an intege 阅读全文
posted @ 2017-08-24 16:37 北梗 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Problem Description(数根) The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit 阅读全文
posted @ 2017-08-24 16:21 北梗 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission o 阅读全文
posted @ 2017-08-24 16:12 北梗 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at w 阅读全文
posted @ 2017-08-24 16:06 北梗 阅读(214) 评论(0) 推荐(0) 编辑