上一页 1 ··· 3 4 5 6 7
摘要: 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 阅读全文
posted @ 2025-05-16 13:40 arin876 阅读(16) 评论(0) 推荐(0)
摘要: A https://codeforces.com/gym/105588/problem/M 还是有点难读,相邻两个的和不能重复出现。 打表,奇数偶数分开打表,发现奇数错开一个,偶数照常 #include<iostream> using namespace std; #include<cstring> 阅读全文
posted @ 2025-05-15 22:45 arin876 阅读(11) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-04-18 09:39 arin876 阅读(34) 评论(0) 推荐(0)
摘要: A 如果有3个以上连着的,不停从中间取水,可以填完 否则有几个要几个 #include<iostream> using namespace std; int n; string str; int main(){ int T;cin>>T; while(T--){ cin>>n; cin>>str;b 阅读全文
posted @ 2025-04-17 21:35 arin876 阅读(32) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7