C16H:Magical Balls 总时间限制: 1000ms 内存限制: 262144kB 描述 Wenwen has a magical ball. When put on an infinite plane, it will keep duplicating itself forever. Initially, Wenwen puts the ball on the location (x0, y0) of the plane. Then the ball starts to dup…
Problem A Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 463 Accepted Submission(s): 162 Problem Description 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串.现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的…
瞬间移动 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2121 Accepted Submission(s): 949 Problem Description 有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以选择一个右下方格子,并瞬移过去(如从下图中的红色格子能直接瞬移到蓝色格子),求到第n行第m列的格子有几…
题目地址:https://www.nowcoder.com/acm/contest/136/F 树状数组.快速幂.逆元的模板运用: #include<iostream> #include<cstdio> using namespace std; #define LL long long #define lowbit(x) x&-x ; ; int n, m; LL sum[N]; void read(int &x) { ; x = ; char ch = getch…
A Boring Question 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5793 Description Input The first line of the input contains the only integer T, Then T lines follow,the i-th line contains two integers n,m. Output For each n and m,output the answer i…
Sumdiv Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16466 Accepted: 4101 Description Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 99…
E - The Boss on Mars Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4059 Description On Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss. Due…
#include <iostream> #include <algorithm> #include <string> #define MOD 1000000007 using namespace std; long long quick_pow(long long a, long long b, long long c){ ; a = a%c; ){ == ){ ans = (ans*a) % c; } b = b / ; a = (a*a) % c; } return…
A Boring Question Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 156 Accepted Submission(s): 72 Problem Description Input The first line of the input contains the only integer T,(1≤T…
Problem Description Considera positive integer X,and let S be the sum of all positive integer divisors of2004^X. Your job is to determine S modulo 29 (the rest of the division of S by29). Take X = 1 for an example. The positive integer divisors of 20…
It is said that a dormitory with 6 persons has 7 chat groups ^_^. But the number can be even larger: since every 3 or more persons could make a chat group, there can be 42 different chat groups. Given N persons in a dormitory, and every K or more per…
题目来源 The 2018 ACM-ICPC China JiangSu Provincial Programming Contest 35.4% 1000ms 65536K Persona5 Persona5 is a famous video game. In the game, you are going to build relationship with your friends. You have N friends and each friends have his upper b…
Description Mr. Mindless has many balls and many boxes,he wants to put all the balls into some of the boxes.Now, he wants to know how many different solutions he can have. you know,he could put all the balls in one box,and there could be no balls in…