地址:http://acm.hdu.edu.cn/showproblem.php?pid=1212题意:求一个数(大数)对另一个数(小数)的模。mark:大数除法求模,简单。代码:# include <stdio.h>int n ;char str[1010] ;int calc(){ int i, cc = 0 ; for (i = 0 ; str[i] ; i++) { cc = cc * 10 + str[i] - '0' ; cc %= n ; } return cc ;}int main (){ while (~scan...
转载
2012-02-02 23:31:00
31阅读
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2920 Accepted Submission(s): 19
原创
2012-07-27 14:28:23
936阅读
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3256 Accepted Submission(s): 2219Problem DescriptionAs 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 cal
转载
2013-01-09 18:44:00
47阅读
题目大意:输入两个数字a,b。输出a%b解题思路:大数取余代码如下:package com.njupt.bigInteger;import java.math.BigInteger;import java.util.Scanner;public class HDU_1212_1 { public static void main(String[] args
原创
2013-08-12 10:14:03
66阅读
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3256 Accepted Submission(s): 2219
Problem Descript
原创
2023-03-22 06:28:02
43阅读
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (
原创
2023-02-16 19:35:06
85阅读
//Scriptname:log_analyse//Author:charlotte//date:2016/03/17//Purpose: sleve log and connect save on database/*defina head file*/#include "stdio.h"#include "stdlib.h"#include "string.h" /*use functi
原创
2016-03-30 20:48:45
360阅读
方法一:我自己写的 # with t as # ( # select * # ,case when host_goals>guest_goals then 3 when host_goals=guest_goals then 1 else 0 end as host_score, # case wh ...
转载
2021-08-09 16:35:00
40阅读
/*解题思路:分解为十进制的一位,每位求余一次。即设str[0--n]为大数(0为个位,1为十位,2为百位,...)
有
ans[0] = str[0] % b;
ans[1] = str[1] * 10 % b;
.
.
.
ans[n] = str[n]*10^n % b;
这里要解决对10的n次方求余的问题,其实很简单,设temp[k]=10^k%b,必有
temp[k] = temp[k]
原创
2014-02-13 17:38:55
635阅读
LETTERS 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 5 const int N=30; 6 int r,c,ans,a[N][N],cap[N]; 7 void solve(int,int,int); 8 ...
转载
2021-08-05 11:35:00
162阅读
trie树最基本的应用了不难得到f[i]=f[j] if (s[j+1~i]∈dictionary);可以用trie树匹配
1 var can,f:array[0..1000010] of boolean;
2 son:array[0..1000010,1..26] of longint;
3 j,l,i,t,n,m,ans:longint;
4 ss:ansi
转载
2015-01-09 21:27:00
36阅读
2评论
题意:有n个人,从1到n,编号越大职位越低,然后给出了第2到第n个人的上司的编号,每个人可以有一堆小弟但只能有一个上
原创
2023-06-29 00:15:04
48阅读
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 pr
原创
2022-05-14 11:43:54
69阅读
http://www.elijahqi.win/archives/1071背景小杉家族遭遇了前所未有的大危机 他想知道怎么逃生描述小杉
原创
2022-08-08 13:53:23
73阅读