A:8min才过??? #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define int long long ')) c=getchar();return c;} ?n:gcd(m,n%m);} int read() {…
“连剑都插在了地上,可是我不应该就这么承认失败,想要到达山顶的人,不应该在山脚下就倒下啊” Day -5 (2019.1.15) 学考结束了,文化课暂停一段.早上飞机前往中山纪念中学.纪中好大呀,果然建在山脚下,比学军大到不知道哪里去了. 接下来四天在纪中做了四套模拟赛,感觉纪中人好强啊,不是很打得过啊. Day -4 这套题挺清真的,这可能是我这几天唯一一次考的不错的一天了吧. $T1$是一个简单的线段树优化建图,然后跑一个$Tarjan$就没了,不过唯一的坑点就在于$jzoj$的栈空间好像…
A 签到(a-b problem不用贴了吧,以后atcoder小于300分题均不贴代码) B 发现选择的p,q一定是其中两点间的距离,于是可以O(n2)枚举两点,再O(n2)判断,其实可以做到O(n3)不过O(n4)就够了. #include<bits/stdc++.h> using namespace std; typedef long long ll; int n,ans; ll x[],y[]; int main() { scanf("%d",&n); ans…
A 签到 #include<bits/stdc++.h> using namespace std; ],t[],ans; int main() { scanf("%d%d",&n,&m); ,x;i<=n;i++)scanf(]++; ,x;i<=m;i++)scanf(]++; ans=min(s[],t[])+min(s[],t[]); printf("%d",ans); } B 要求40次,而log(1e6)≍20,也就…
A:求出该行该列各有多少个比其小的取max,该行该列各有多少个比其大的取max,加起来即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 1010 char ge…
日常猝死. A:f[i]表示子树内包含根且可以继续向上延伸的路径的最大价值,统计答案考虑合并两条路径即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 30001…