The Embarrassed Cryptographer Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 13041 Accepted: 3516 Description The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of user…
大数取模问题.题目传送门:HDU1212 #include <iostream> using namespace std; char a[1010]; int main() { int b; while (cin >> a>> b) { int flag = 0; for (int i = 0; a[i] != '\0'; i++) flag = ((flag * 10) % b+ (a[i] - '0') %b) % b; cout << flag <…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1212 Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I…
Big Number Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 10000…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1214 用java写大数果然是方便多了! import java.math.BigInteger; import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner cin = new Scanner(System.in); int n = c…
Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B. To make the problem easier, I promise that B will be smaller than 100000. Is it t…
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9006 Accepted Submission(s): 6100 Problem Description As we know, Big Number is always troublesome. But it's really important in ou…
1243. Divorce of the Seven Dwarfs Time limit: 1.0 second Memory limit: 64 MB After the Snow White with her bridegroom had left the house of the seven dwarfs, their peaceful and prosperous life has come to an end. Each dwarf blames others to be the re…
A. Laptops time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expensive a laptop is, the…
题目链接: Segment Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description Silen August does not like to talk with others.She like to find some interesting problems. Today she finds an interesting pro…
Description Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,B,C<2^63). Input There are multiply testcases. Each testcase, there is one line contains three integers A, B and C, separated by a single space. Output For each tes…
题面 输入只有5位,所以转化为long long类型用快速幂取模 前面补0的写法printf("%05lld\n",ans);如果ans不足5位会在前面补0 #include<bits/stdc++.h> using namespace std; long long mod_exp(long long a, long long b, long long c) //快速幂取余a^b%c { long long res, t; res = % c; t = a % c; whi…
Grids Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 93 Accepted Submission(s): 25 Problem Description 度度熊近期非常喜欢玩游戏.这一天他在纸上画了一个2行N列的长方形格子. 他想把1到2N这些数依次放进去.可是为了使格子看起来优美,他想找到使每行每列都递增的方案.只是画了…