題目地址:http://acm.fzu.edu.cn/contest/list.php?cid=113
A: 計數
/*****************************************<br />** Description: Given a string of number, and a prime P<br />Get the number of numbers satisfying x*x = a(mod P), (0<=x<p)<br />** Algorithm:高精度/單精確度<br />*****************************************/<br />#include <iostream><br />#include <cmath><br />using namespace std;<br />int cases, a, p;<br />char bign[1010];<br />int MOD(char s[], int p) {<br />int ans = 0;<br />for (int i = 0; s[i]; i++) {<br />ans = 10*ans+(s[i]-'0');<br />ans = ans % p;<br />}<br />return ans;<br />}<br />int main() {<br />scanf("%d/n", &cases);<br />while (cases--) {<br />scanf("%s %d/n", bign, &p);<br />a = MOD(bign, p);<br />int ans = 0;<br />for (int i = 0; i < p; i++)<br />if ((pow(i,i) % p == a) ans++;<br />printf("%d/n", ans);<br />}<br />}<br />
B:排列
C:計數
D:線段問題
E:
F:ACM和ICPC數制 類比題
G:LCS && EditPlus
H:類比題