#include<iostream>#defineint long longusingnamespacestd;voidsolve(){intk, l1, r1, l2, r2; cin >> k >> l1 >> r1 >> l2 >> r2;intcur =1, ans =0;while(cur <= r2) {//由公式得 x 新的左右范围,取交集intL =max(l1, (l2 + cur -1) / cur);intR =min(r1, r2 / cur);if...
I was practising earlier today on this problem from the most recent contest. When I use a bitset of size 5005, I get a memory usage of 3688KB. When I use a bitset of size 50005, I get a memory usage of 31168KB. When I use a bitset of size 400005, I get a memory usage of a...