题目传送门 题意:问n位最小能整除47的数字 分析:打表发现前面都是100000...,后两位就是100000%47后到47的距离,就是快速幂求1000000%47的值,47-它就是后两位 #include <bits/stdc++.h> using namespace std; const int A = 47; int pow_mod(int x, int n, int p) { int ret = 1; while (n) { if (n & 1) ret = 1ll * ret…
总算今天静下心来学算法.. Description Innocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the entrance of the tomb while Dumb Zhang’s at the end of it. The tomb is made up of many chambers, the total number is N. And there are M channels connect…
题目描述 Recently, Miss Huang want to receive a Tree as her birthday gift! (What a interesting person!) As a interesting person, Miss Huang likes interesting tree. The interesting tree is a tree with the Max interesting degree. The interesting degree eq…
Rebuild Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 521 Accepted Submission(s): 125 Problem Description Archaeologists find ruins of Ancient ACM Civilization, and they want to rebuild i…
Bazinga Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 214 Accepted Submission(s): 89 Problem Description Ladies and gentlemen, please sit up straight.Don't tilt your head. I'm serious.For n…
Pagodas Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 70 Accepted Submission(s): 62 Problem Description n pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yun…