06 2021 档案
摘要:一天打两场,爽到(确信 传送门:https://atcoder.jp/contests/abc161/ A #include<bits/stdc++.h> using namespace std; int main(){ int a, b, c; cin>>a>>b>>c; swap(a, c),
阅读全文
摘要:A #include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; if(s[2]==s[3] && s[4]==s[5]) puts("Yes"); else puts("No"); return 0; } B
阅读全文
摘要:这场挺难orz A tag 有二分emm,但我没二分 把严格大于转化为大于等于,然后求个临界点,特判一下边界即可。 #include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T--){ int a, b
阅读全文
摘要:这次的题目挺简单的awa A #include<bits/stdc++.h> using namespace std; int main(){ int a, b; cin>>a>>b; cout<<a*(a-1)/2+b*(b-1)/2; return 0; } B #include<bits/st
阅读全文
摘要:传送门:https://atcoder.jp/contests/abc158 A #include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool ok1=false, ok2=false; for(aut
阅读全文
摘要:题目是今天中午我在车站写的,纪念一下~ 前三题很水就不说了。 A #include<bits/stdc++.h> using namespace std; int main(){ int c, r; cin>>c>>r; r= c>=10? r: (10-c)*100+r; cout<<r; ret
阅读全文
摘要:传送门:https://codeforces.com/contest/1207 A 模拟 #pragma GCC optimize("O3") #include<bits/stdc++.h> using namespace std; #define endl '\n' #define debug(x
阅读全文
摘要:传送门:https://atcoder.jp/contests/abc154/tasks A #include<bits/stdc++.h> using namespace std; int main(){ string a, b; cin>>a>>b; int x, y; cin>>x>>y; s
阅读全文
摘要:传送门:https://atcoder.jp/contests/abc153/tasks A 向上取整 #include<bits/stdc++.h> using namespace std; int main(){ int a, b; cin>>a>>b; cout<<(a+b-1)/b; ret
阅读全文
摘要:传送门: A int main(){ int n, m; cin>>n>>m; if(n>m) puts("No"); else puts("Yes"); return 0; } B int main(){ int a, b; cin>>a>>b; if(a>b) swap(a, b); int a
阅读全文
摘要:竟然顺利地AK了,爽到( 传送门:https://atcoder.jp/contests/abc151 A 语法题 #include<bits/stdc++.h> using namespace std; int main(){ char ch; cin>>ch; cout<<(char)(ch+1
阅读全文
摘要:这题贪心的话似乎不太可行我没想出怎么贪,所以用区间dp来解决。 更好的阅读体验:qwq 分析 表示先手在区间 的最优决策所能给他带来的贡献,因为区间 的总和 是一定的,那么这个最优决策在意味着最大化自己的收益
阅读全文
摘要:分析 如果直接使用LCS来解决,那么复杂度为 ,显然会超时。 因为给出的两个序列的数都是互不相同的,我们将第一个序列的数按 依次编号,然后将第二个序列的数(当然这个数应该是存在于第一个序列的)按照数值映射到相应的编号中,注意到题目所求的LCS恰好就是第二
阅读全文
摘要:目录 莫比乌斯函数 莫比乌斯反演 莫比乌斯函数 首先,我们先介绍一下莫比乌斯函数 设 质因数分解式为: $$\mu(x)= \begin 0& \exists \alpha_i \geqslan
阅读全文
摘要:传送门: https://www.luogu.com.cn/problem/P3327 https://www.acwing.com/problem/content/1360/ 莫比乌斯反演 + 整除分块 分析 首先,我们给出一个结论: \[ d(ij) = \sum_{x|i} \sum_{y|j
阅读全文