AtCoder
文章平均质量分 84
Xuhx&
这个作者很懒,什么都没留下…
展开
-
AtCoder Regular Contest 133
题目链接A - Erase by Value题目大意:从数组A中选取一个数x,A中不是x的组成数组B,要求B的字典序最小,输出B。思维, 虽说是思维,但理解题意上还是有一定困难的。分析字典序:从前往后依次比较,遇到第一个>或<的数时即比较出了答案,若最后一个数仍相同则两者相同从前往后找,若A[i] <= A[i + 1]则A[i]在A[i + 1]前更优,A[i]不必去; 若A[i] > A[i + 1]则A[i + 1]在前,A[i]去掉会使整个序列字典序更小。#原创 2022-01-24 21:01:54 · 461 阅读 · 0 评论 -
AtCoder Beginner Contest 234
A - Weird Function给出f函数表达式,求:f(f(f(t)+t)+f(f(t)))签到题重复利用的代码,最好写一个函数出来#include <bits/stdc++.h>using namespace std;int f(int x){ return x * x + 2 * x + 3;}int main() { int t; cin >> t; int ans = 0; int ft = f(t);原创 2022-01-10 13:23:58 · 548 阅读 · 0 评论 -
AtCoder Beginner Contest 233
题目链接A - 10yen Stamp题目大意:给定两个数X、Y,问X加多少个10,使得X >= Y考点:向上取余#include <iostream>#include <algorithm>using namespace std;int main(void){ int a, b; cin >> a >> b; int t = b - a; int ans = 0; if(t <= 0) co原创 2021-12-28 16:34:31 · 491 阅读 · 0 评论 -
AtCoder Regular Contest 132
题目链接 https://atcoder.jp/contests/arc132/tasksA.Permutation Grid题目大意:第一行给定一个n的排列R1…Ri…Rn,表示第i行有几个"#", 下一行给定1-n的另一个排列C1…Cj…Cn,表示第j列有多少个“#”, 下面q个询问,问第x行y列是不是“#”。猛的一看以为是构造,但看了大佬的代码,我更愿称其为规律吧。以样例一为例,n=5时,我们一共有 1+2+3+4+5=15个“#”, 在两个排列中随机各抽一个相加,发现一共有15个的和是大于5原创 2021-12-28 15:35:42 · 372 阅读 · 2 评论