题目链接:https://atcoder.jp/contests/abc121/tasks/abc121_d 题目很裸(Atcoder好像都比较裸 就给一个区间求异或和 n到1e12 肯定不能O(n)推 那肯定得通过异或的一些性质 用$f\left( a,b\right)$表示[a,b]区间的异或和 我只观察出了$f\left( 2^{a},2^{b}-1\right)$的异或和肯定为0. 通过$f\left( 2^{a},2^{a+1}-1\right)$每一位都会出现偶数次 例如 [4,8)…
题目链接:https://atcoder.jp/contests/abc121 A White Cells 分析:题目数据规模很小,直接暴力修改都可以.或者可以推出公式. 代码: #include <iostream> #include <cstdio> using namespace std; int main() { ][] = {}; int H, W, h, w; scanf("%d %d", &H, &W); scanf("%…
D - Xor Sum 2 Time limit : 2sec / Memory limit : 1024MB Score : 500 points Problem Statement There is an integer sequence A of length N. Find the number of the pairs of integers l and r (1≤l≤r≤N) that satisfy the following condition: Al xor Al+1 xor …
人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We have A balls with the string S written on each of them and B balls with the string T written on each of them. From these balls, Takahashi chooses one…
AtCoder Beginner Contest 238 \(A - F\) 题解 A - Exponential or Quadratic 题意 判断 \(2^n > n^2\)是否成立? Solution 当 \(n\) 为 2,3,4 的时候不成立,否则成立 Code #include <bits/stdc++.h> using namespace std; using LL = long long; int main() { int n; cin >> n; bool…
AtCoder Beginner Contest 260 - AtCoder D - Draw Your Cards 题意:N张卡牌数字 1-n,以某种顺序排放,每次拿一张,如果这一张比前面某一张小(不是最大的) ,就把它放在比他大的牌中数字最小的,如果没有就单独放在第一个位置,当某个位置的牌数达到k张,就将他们拿走,问最后每张牌都会在第几次操作被拿走,如果没被拿走输出 -1. 题解:可以利用set或者map这种自动排序的迭代器来进行存储,然后利用二分找到第一个比它大的数字,然后进行操作即可.…
A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E869120's and square1001's 16-th birthday is coming soon.Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces. E869…
没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder Beginner Contest 052 A题意: 输出大的面积? 思路: max(A*B,C*D); AtCoder Beginner Contest 052 B题意: 枚举过程,然后...太水了.. AtCoder Beginner Contest 052 C题意: 输出N!的因子个数mod1…
A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) oth…
AtCoder Beginner Contest 136 题目链接 A - +-x 直接取\(max\)即可. Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; cout &…