摘要:
A. Elevator or Stairs? 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int x, y, z, t[3]; 5 6 int main() 7 { 8 while (scanf("%d%d%d", &x, &y, 阅读全文
摘要:
A. The King's Race 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ll long long 5 ll n, x, y; 6 7 ll f(ll a, ll b) 8 { 9 return max(a 阅读全文
摘要:
A. Superhero Transformation 签 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 1010 5 char s[N], t[N], Hash[N]; 6 7 bool ok() 8 { 9 int 阅读全文
摘要:
A:Jin Yong's Wukong Ranking List 阅读全文
摘要:
M:Function and Function 阅读全文
摘要:
A. Xu Xiake in Henan Province 阅读全文
摘要:
Problem A. Mischievous Problem Setter 签到. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ll long long 5 #define N 100010 6 #define pii 阅读全文
摘要:
A. Lunar New Year and Cross Counting 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 510 5 int n; 6 char G[N][N]; 7 8 int main() 9 阅读全文
摘要:
A. Salem and Sticks 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 1010 5 int n, a[N]; 6 7 int work(int x) 8 { 9 int res = 0; 10 f 阅读全文
摘要:
A. Definite Game 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 int a; 7 while (scanf("%d", &a) != EOF) 8 { 9 [](int x) 10 阅读全文
摘要:
Replay Dup4: 厕所是个换换脑子的好地方? 要读题啊,不要别人不做,自己就跟着不做啊 X: 读题很重要啊!什么时候才能读对题 不演队友啊 D题看错题, 直到最后一小时才看懂 很多时候要看榜单做题 A:Aqours Solved. 考虑一个点的子树下面有多少个叶子节点汇聚, 那么这个时候就可 阅读全文
摘要:
A. Digits Sequence Dividing 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 1010 5 char s[N]; int n; 6 7 void solve() 8 { 9 if (n = 阅读全文
摘要:
Replay Dup4: 啥都不会? 只能看着两位聚聚A题? X: 模拟题不会写, 日常摔锅 u, v分不清, 日常演员 又是自己没理清楚就抢键盘上机导致送了一万个罚时, 日常背锅 A:迷宫 Solved. 考虑所有人从1号点排队出发,所有人都回到自己位置的时间 让深度大的先走,这样就不会产生堵塞 阅读全文
摘要:
Replay: Dup4: 时间复杂度算不对? 一点点思路不经过验证就激动的要死? 浪费自己一个小时还浪费别人一个小时? 对1e3不敏感? 1e3 * 1e3是多少? 模拟建边跑dp不写非要写个大模拟? 看到数据结构就高兴的要死? 没细想? 没发现性质? X: 日常语文差, 导致计算几何死都写不对 阅读全文
摘要:
Replay Dup4: 两轮怎么退火啊? 简单树形dp都不会了,送了那么多罚时 简单题都不想清楚就乱写了,喵喵喵? X: 欧拉怎么回路啊, 不会啊。 还是有没有手误?未思考清楚或者未检查就提交, 导致自己白送罚时。 A:夺宝奇兵 Solved. 考虑$所有i >= 2 需要跟i - 1 连两条边 阅读全文
摘要:
A. Splitting into digits Solved. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int n; 5 6 void solve() 7 { 8 printf("%d\n", n); 9 for (int i = 阅读全文
摘要:
Replay Dup4: 没想清楚就动手写? 写了两百行发现没用?想的还是不够仔细啊。 要有莽一莽的精神 X: 感觉今天没啥输出啊, 就推了个公式?抄了个板子, 然后就一直自闭A。 语文差,题目没理解,导致写了接近三小时的A吧, 最后看了一眼群, 发现自己理解错了。 以及感觉自己最近不会交流,有点毒 阅读全文
摘要:
Class $A_i = a \cdot i \% n$ 有 $A_i = k \cdot gcd(a, n)$ 证明: $A_0 = 0, A_x = x \cdot a - y \cdot n$ $令 d = gcd(a, n)$ $A_x \% d = (x \cdot a \% d - y 阅读全文
摘要:
Replay Dup4: 要是不挂机,再多仔细想想就好了 J确实自闭好久,一直在想正确性,最后数据错了,喵喵喵? 还是要保证充足的休息啊,中间睡了一小会儿,也不知道睡了多久,醒来他们就又过了一道 要发掘题目更多的性质和有用条件啊,算法和数据结构只是工具,不要总想着这是啥题这是啥题,我会不会,其实我啥 阅读全文
摘要:
A: Little Sub and Pascal's Triangle Solved. 题意: 求杨辉三角第n行奇数个数 思路: 薛聚聚说找规律,16说Lucas 答案是 $2^p \;\;p 为 n - 1 中 以2进制表示下1的个数$ 证明 $Ans = \sum\limits_0^n C_n^ 阅读全文
摘要:
建最短路树的时候,优先队列加一条限制,当花费相同的时候id小的排前面 这样建出来的最短路树就是符合题意的 再考虑点分治 因为不满足前缀加减性,那么考虑按序遍历即可 考虑如何同时维护最大值及其个数 判断当前值是大于还是等于已经存的值 如果大于 替换掉,次数置为1 如果等于 次数++ 1 #includ 阅读全文
摘要:
点分治,定权值,求另一关键字最小 不满足前缀加减性 可以按序遍历,用一数组$t[] 来维护路径为i的最小边数$ 再对于一个直系儿子对应的子树,先算距离求答案再更新$t数组,这样就不会重复$ 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 # 阅读全文
摘要:
点分治,每次维护出边长模3余0, 1, 2的个数 那么答案就是 $cnt[0] * cnt[0] + cnt[1] * cnt[2] * 2$ 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ll long long 5 # 阅读全文
摘要:
A. Roman and Browser 签到. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int n, k, a[110]; 5 6 int get(int b) 7 { 8 int vis[110]; 9 memset(vis, 阅读全文
摘要:
A - Beginning 签到. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 int a[4]; 7 while (scanf("%d", a) != EOF) 8 { 9 for (int i = 阅读全文
摘要:
A - Bulletin Board 签到。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 int n, h, w; 7 while (scanf("%d%d%d", &n, &h, &w) != EOF 阅读全文
摘要:
A. Minimum Integer 签到。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ll long long 5 ll l, r, d; 6 7 int main() 8 { 9 int t; scanf("%d" 阅读全文
摘要:
D. Deja vu of … Go Players 签。 1 #include <bits/stdc++.h> 2 using namespace std; 3 int t, n, m; 4 5 int main() 6 { 7 scanf("%d", &t); 8 while (t--) 9 { 阅读全文
摘要:
A. Snowball 签。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int w, h, u[2], d[2]; 5 6 int main() 7 { 8 while (scanf("%d%d", &w, &h) != EOF) 9 阅读全文
摘要:
A. Gennady and a Card Game 签到. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 char s[5], t[5]; 5 6 bool solve() 7 { 8 int flag = false; 9 for ( 阅读全文
摘要:
A. New Year and the Christmas Ornament 签到。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int a, b, c; 5 6 int main() 7 { 8 while (scanf("%d%d% 阅读全文
摘要:
A - Poisonous Cookies 签到。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ll long long 5 ll a, b, c; 6 7 int main() 8 { 9 while (scanf(" 阅读全文
摘要:
A. Find Divisible 签到。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int t, l, r; 5 6 int main() 7 { 8 scanf("%d", &t); 9 while (t--) 10 { 11 s 阅读全文
摘要:
A. Right-Left Cipher Solved. 注意长度的奇偶 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 string s; 5 int main() 6 { 7 while (cin >> s) 8 { 9 string 阅读全文
摘要:
C - Product and GCD Solved. 题意: 给出$n个数$的乘积,求$这n个数$的最大的可能是GCD 思路: 分解质因子,那么$每个质因子的贡献就是其质因子个数/ n的乘积$ 1 #include <bits/stdc++.h> 2 using namespace std; 3 阅读全文
摘要:
Problem A. Jhadgre的C语言程序 签。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 puts("Helle World!"); 7 return 0; 8 } Problem B. Wp 阅读全文
该文被密码保护。 阅读全文
摘要:
A. Dice Rolling 签到. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int t, n; 5 6 int main() 7 { 8 scanf("%d", &t); 9 while (t--) 10 { 11 scanf( 阅读全文
摘要:
训练地址 A: 树剖板子题 求最小值的时候要注意值是不是有负数,如果有,初值要置为$-INF$ 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 30010 5 #define INF 0x3f3f3f3f 6 int n 阅读全文
摘要:
A. Rikka with Minimum Spanning Trees 题意: 给出一个图,求最小生成树的个数和权值 思路: 因为数据随机,只有一个MST 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define ull unsig 阅读全文