摘要:
实际上,本题就是高斯消元解同余方程组,就是把原来的除法换成逆元,其他的都一样。 #include<bits/stdc++.h> using namespace std; const int N = 110; int n, p; int a[N][N]; char s[N]; int power(in 阅读全文
摘要:
大水题。 题目很简单,只需一个单词一个单词依次处理,判断即可。在这里使用 \(ans\) 存储当前行的字母数量。 #include <iostream> using namespace std; int main() { int n, k, ans = 0; cin >> n >> k; while 阅读全文
摘要:
AcWing 周赛题目。 介绍一种比较奇怪的写法。 对于每个数,统计它是否出现过,如果没有出现就持续将它 \(+1\),然后统计答案即可。 #include <iostream> using namespace std; int a[30010]; bool flag[30010]; int mai 阅读全文