摘要:
D. I Love 1543 积累网格方法 一圈,L,R,D,U 要把n-1个加上,substr #include<iostream> using namespace std; const int N=1010; int n,m; int a[N][N]; int main(){ int T;cin 阅读全文
摘要:
C. Superultra's Favorite Permutation 打表出构造 #include<iostream> using namespace std; int n; /** * #include<iostream> using namespace std; int n; int a[1 阅读全文
摘要:
A 数据结构 B 鸽巢原理,特殊情况一个小时才看出来 D https://ac.nowcoder.com/acm/problem/272306 公约数为z,那就a=cz,b=dz,(c,d)=1 如果让d=1,就不用考虑互质 z(c-1)>=x z(c+1)>=y 取大即可 #include<ios 阅读全文
摘要:
D 绝对值画图 借个图 只有两个线段不相交时,才能有增加,也就是max(a[i],b[i])<min(a[j],b[j])或者max(a[j],b[j])<min(a[i],b[i]) 扫维护max(a[i],b[i])和min(a[i],b[i]) #include<iostream> using 阅读全文
摘要:
A 如果有3个以上连着的,不停从中间取水,可以填完 否则有几个要几个 #include<iostream> using namespace std; int n; string str; int main(){ int T;cin>>T; while(T--){ cin>>n; cin>>str;b 阅读全文