摘要:
传送门 A - Kth Term #include <bits/stdc++.h> #define ll long long using namespace std; int a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 阅读全文
摘要:
传送门 A - Hitachi String #include <bits/stdc++.h> #define ll long long using namespace std; char s[15]; int main() { //freopen("in.txt","r",stdin); scan 阅读全文
摘要:
传送门 A - Station and Bus #include <bits/stdc++.h> using namespace std; char s[5]; int main() { //freopen("in.txt","r",stdin); scanf("%s",s); int a=0,b= 阅读全文
摘要:
传送门 A - Duplex Printing #include <bits/stdc++.h> #define ll long long using namespace std; int main() { //freopen("in.txt","r",stdin); int n; scanf("% 阅读全文
摘要:
传送门 A - Beginner #include <bits/stdc++.h> #define ll long long using namespace std; int main() { //freopen("in.txt","r",stdin); int n,r; scanf("%d%d", 阅读全文
摘要:
描述 Given an N x N square grid (2 <= N <= 15) and each grid has some beans in it. You want to write at most K (1 <= K <= 2N - 2) horizontal or vertical 阅读全文
摘要:
描述 FJ now is a postman of a small town in the hills. The town can be represented by a N×N matrix. Each field is represented with:-'K' character: a hou 阅读全文
摘要:
题意:求$(\sum_{i=1}^{n}\sum_{j=1}^{n}ijgcd(i,j))mod p$(p为质数,n<=1e10) 很显然,推式子。 $\sum_{i=1}^{n}\sum_{j=1}^{n}ijgcd(i,j)$ =$\sum_{d=1}^{n}\sum_{i=1}^{n}\sum 阅读全文
摘要:
题意:求$\sum_{i=1}^{n}\sum_{j=1}^{m}lcm(i,j)$。 开始开心(自闭)化简: $\sum_{i=1}^{n}\sum_{j=1}^{m}lcm(i,j)$ =$\sum_{d=1}^{n}\sum_{i=1}^{n}\sum_{j=1}^{m}\frac{ij}{d 阅读全文
摘要:
题意:$\sum_{i=1}^{n}\sum_{j=1}^{n}[gcd(i,j)\epsilon prime]$。 对于这类题一般就是枚举gcd,可得: =$\sum_{d\epsilon prime}\sum_{i=1}^{n}\sum_{j=1}^{n}[gcd(i,j)==d]$ =$\su 阅读全文