1304

P1304 哥德巴赫猜想

哥德巴赫猜想:任意一个大于2的偶数都可以写成两个质数之和 思路:枚举质数 //哥德巴赫猜想 #include<bits/stdc++.h> using namespace std; bool check(int x){ if(x<=1)return false; for(int i=2;i<=sqr ......
P1304 1304

CF1304E 1-Trees and Queries(lca+树上前缀和+奇偶性)

题目 二话不说,直接按题意模拟暴搜,当然 \(O(nq)\) 的复杂度显然是寄了的。 不过,在模拟的过程中,我在链式前向星的删边中居然一开始错了,还是要 mark 一下以后注意。 void del(int x, int pre) { e[top].to = e[top].next = 0; h[x] ......
奇偶 前缀 Queries 1304E Trees
共2篇  :1/1页 首页上一页1下一页尾页