版本比较
论在键盘的大部分标点符号都坏掉的情况下都可以做些什么
正文
增加 26 行删除 26 行
255 行未改动全部展开256257258259260260261262263264135 行未改动全部展开40040140240340440440540640740813 行未改动42242342442542642742642742842943043143243343443543643643743843944044144144244344444511 行未改动4574584594604614614624634644644654664674686 行未改动4754764774784794794804814824834844854864874884894894904914924936 行未改动500501502503504504505506507508104 行未改动全部展开61361461561661761761861962062110 行未改动63263363463563663663763863964025 行未改动66666766866967067067167267367410 行未改动68568668768868968969069169269354 行未改动748749750751752752753754755756165 行未改动全部展开92292392492592692692792892993040 行未改动97197297397497597597697797897990 行未改动107010711072107310741074107510761077107810791079108010811082108350 行未改动113411351136113711381138113911401141114234 行未改动117711781179118011811181118211831184118543 行未改动122912301231123212331233123412351236123712381238123912401241124239 行未改动128212831284128512861286128712881289129025 行未改动131613171318131913201320132113221323132426 行未改动255 行未改动全部展开 if (t xor_eq l) <%%> if (l and_eq t xor l) <%%> if (l xor_eq l xor (l << 1)) <%%> %> if (t or_eq l) <%%> if (t or_eq l) <%%> %>%>```
135 行未改动全部展开 %> %> %> if (std::cout << ans) <%%> %> %> %>%>```
13 行未改动%:include<vector>
int main() <% if (std::ios::sync_with_stdio(0)) <%%> for (int n : <%0%>) if (std::cin >> n) for (int B : <%std::sqrt(n)%>) for (int n : <%0%>) if (std::cin >> n) for (int B : <%std::sqrt(n)%>) for (long long ans : <%0%>) for (auto a : std::array<%std::vector<int>(n)%>) for (auto b : <%std::vector<int>(n)%>) for (auto sum : <%std::vector<int>(n)%>) for (auto mp : <%std::vector<int>(n)%>) for (auto pos : <%std::vector<int>(n)%>) for (auto l : <%std::vector<int>(n)%>) for (auto r : <%std::vector<int>(n)%>) <% for (auto bitand i : a) if (std::cin >> i) <%%> for (auto bitand i : a) if (std::cin >> i) <%%> for (int i : std::views::iota(0) bitor std::views::take(n)) if (b<:i:> xor_eq a<:i:>) <%%> for (auto i : <%std::ranges::sort(b)%>) <%%> for (int i : std::views::iota(0) bitor std::views::take(n)) <% for (int l : <%0%>) for (int r : <%n%>) for (int r : <%n%>) for (int res : <%0%>) <% for (int b : <%0xffffffff%>) <% while (r bitand b) <% if (r xor_eq b) <%%> if (b and_eq r xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (r or_eq b) <%%> %> while (l < r or not (l xor r)) <% for (int mid : <%l%>) <%11 行未改动 %> if (a<:i:> xor_eq a<:i:> xor res) <%%> %> %> for (int i : <%0%>) for (int i : <%0%>) for (int t : <%0%>) <% while (i < n) <% for (int b : <%1%>) <% while (t bitand b) <% if (t xor_eq b) <%%> if (b and_eq t xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (t or_eq b) <%%> %>if (l<:t:> xor_eq i) <%%> for (int b : <%1%>) <% while (t bitand b) <% if (t xor_eq b) <%%> if (b and_eq t xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (t or_eq b) <%%> %>if (l<:t:> xor_eq i) <%%> for (int j : <%i%>) <% for (int b : <%B%>) <% while (i bitand b) <% if (i xor_eq b) <%%> if (b and_eq i xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (i or_eq b) <%%> %> while (j < i and j < n) <% if (pos<:j:> xor_eq t) <%%>6 行未改动 for (int i : std::views::iota(0) bitor std::views::take(n)) <% for (long long b : <%i%>) <% while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> if (pos<:a<:i:>:> xor 1) <% for (int j : <%0%>) while (j < r<:1:> or not (j xor r<:1:>)) <% for (long long b : <%mp<:j:>%>) <% if (b xor_eq b xor compl b) <%%> while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> for (long long b : <%mp<:j:>%>) <% if (b xor_eq b xor compl b) <%%> while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> for (int b : <%1%>) <% while (j bitand b) <% if (j xor_eq b) <%%> if (b and_eq j xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (j or_eq b) <%%> %> for (long long b : <%1%>) <% while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> %> for (int j : <%2%>) while (j < pos<:a<:i:>:>) <% for (long long b : <%sum<:j:>%>) <% if (b xor_eq b xor compl b) <%%> while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> for (int b : <%1%>) <% while (j bitand b) <% if (j xor_eq b) <%%> if (b and_eq j xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (j or_eq b) <%%> %> for (long long b : <%1%>) <% while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> %> for (int j : <%l<:pos<:a<:i:>:>:>%>) while (j < a<:i:> or not (j xor a<:i:>)) <% for (long long b : <%mp<:j:>%>) <% if (b xor_eq b xor compl b) <%%> while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> for (long long b : <%mp<:j:>%>) <% if (b xor_eq b xor compl b) <%%> while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> for (int b : <%1%>) <% while (j bitand b) <% if (j xor_eq b) <%%> if (b and_eq j xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (j or_eq b) <%%> %> for (long long b : <%1%>) <% while (ans bitand b) <% if (ans xor_eq b) <%%> if (b and_eq ans xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (ans or_eq b) <%%> %> %> %> else <%6 行未改动 for (int b : <%1%>) <% while (mp<:a<:i:>:> bitand b) <% if (mp<:a<:i:>:> xor_eq b) <%%> if (b and_eq mp<:a<:i:>:> xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (mp<:a<:i:>:> or_eq b) <%%> %> for (int b : <%1%>) <% while (sum<:pos<:a<:i:>:>:> bitand b) <% if (sum<:pos<:a<:i:>:>:> xor_eq b) <%%> if (b and_eq sum<:pos<:a<:i:>:>:> xor b) <%%> if (b xor_eq b xor (b << 1)) <%%> %> if (sum<:pos<:a<:i:>:>:> or_eq b) <%%> %> %> if (std::cout << ans) <%%> %> %>%>```
## 更加困难的挑战104 行未改动全部展开 for (int ed : <%0%>) // 蚂蚁是否胜利 for (int mysl : <%0%>) // 活着的蚂蚁数量 for (bool ndg : <%0%>) // 蛋糕有没有被拿 for (int sj : <%0%>) // 当前时间 for (int t : <%0%>) for (int t : <%0%>) for (int cnt : <%0%>) // 累计出生的蚂蚁数量 % 6 for (int tot : <%0%>) // 当前蚂蚁的等级 for (auto dj : <%std::vector<int>(N)%>) // 等级 for (auto nl : <%std::vector<int>(N)%>) // 年龄10 行未改动 for (auto pt : <%std::vector<int>(300)%>) // 同上,这个是是否有炮塔 for (auto xxs : <%std::vector<int>(300)%>) // 同上,这个是信息素 for (auto dg : <%std::vector<int>(N)%>) // 是否有蛋糕 for (auto dx : <%std::vector<int>(4)%>) // 东南西北偏移量 for (auto dy : <%std::vector<int>(4)%>) for (auto dy : <%std::vector<int>(4)%>) for (auto nxt : <%std::vector<int>(1000005)%>) // nxt[i] = i+1 for (auto pre : <%std::vector<int>(1000005)%>) // pre[i] = i-1 for (auto mul : <%std::vector<int>(N)%>) for (auto zh : <%std::vector<int>(N)%>)25 行未改动 for (int ed : <%0%>) // 蚂蚁是否胜利 for (int mysl : <%0%>) // 活着的蚂蚁数量 for (bool ndg : <%0%>) // 蛋糕有没有被拿 for (int sj : <%0%>) // 当前时间 for (int t : <%0%>) for (int t : <%0%>) for (int cnt : <%0%>) // 累计出生的蚂蚁数量 % 6 for (int tot : <%0%>) // 当前蚂蚁的等级 for (auto dj : <%std::vector<int>(N)%>) // 等级 for (auto nl : <%std::vector<int>(N)%>) // 年龄10 行未改动 for (auto pt : <%std::vector<int>(300)%>) // 同上,这个是是否有炮塔 for (auto xxs : <%std::vector<int>(300)%>) // 同上,这个是信息素 for (auto dg : <%std::vector<int>(N)%>) // 是否有蛋糕 for (auto dx : <%std::vector<int>(4)%>) // 东南西北偏移量 for (auto dy : <%std::vector<int>(4)%>) for (auto dy : <%std::vector<int>(4)%>) for (auto nxt : <%std::vector<int>(1000005)%>) // nxt[i] = i+1 for (auto pre : <%std::vector<int>(1000005)%>) // pre[i] = i-1 for (auto mul : <%std::vector<int>(N)%>) // mul[(i<<7)|j] = i*j for (auto zh : <%std::vector<int>(N)%>) // zh[(i<<8)|j] = i+j54 行未改动 if (lst xor_eq lst xor i) <%%> %> for (int i : std::views::iota(1) bitor std::views::take(s)) <% if (std::cin >> px<:i:> >> py<:i:>) <%%> if (pt<:(px<:i:><<4) bitor py<:i:>:> xor_eq 1) <%%> if (pt<:(px<:i:><<4) bitor py<:i:>:> xor_eq 1) <%%> %> if (std::cin >> t) <%%> while (t and not ed) <% if (t xor_eq t xor pre<:t:>) <%%>165 行未改动全部展开 if (not (zh<:(d13<<8) bitor d12:> < d23 or zh<:(d23<<8) bitor d12:> < d13)) for (int f1 : <%1%>) for (int f2 : <%1%>) for (int res : <%0%>) <% if (not (x3 > x1) and y2 > y1 or x3 > x1 and not (y2 > y1)) if (f1 xor_eq f1 xor pre<:f1:>) <%%> if (not (y3 > y1) and x2 > x1 or y3 > y1 and not (x2 > x1)) if (f2 xor_eq f2 xor pre<:f2:>) <%%> if (f1 and f2 or not f1 and not f2) <% if (res xor_eq res xor cj<:(mul<:(cj<:(x3<<8) bitor x1:><<7) bitor cj<:(y2<<8) bitor y1:>:><<8) bitor mul<:(cj<:(y3<<8) bitor y1:><<7) bitor cj<:(x2<<8) bitor x1:>:>:>) <%%> %> else if (res xor_eq res xor zh<:(mul<:(cj<:(x3<<8) bitor x1:><<7) bitor cj<:(y2<<8) bitor y1:>:><<8) bitor mul<:(cj<:(y3<<8) bitor y1:><<7) bitor cj<:(x2<<8) bitor x1:>:>:>) <%%> else if (res xor_eq res xor zh<:(mul<:(cj<:(x3<<8) bitor x1:><<7) bitor cj<:(y2<<8) bitor y1:>:><<8) bitor mul<:(cj<:(y3<<8) bitor y1:><<7) bitor cj<:(x2<<8) bitor x1:>:>:>) <%%> if (not ((pw<:res:><<2) > d12)) <% if (xl<:j:> < d) <% if (xl<:j:> xor_eq xl<:j:> xor compl 0) <%%> %> else <%40 行未改动 %> if (not ed) <% for (int i : std::views::iota(0) bitor std::views::take(nxt<:n:>)) <% for (int j : std::views::iota(0) bitor std::views::take(nxt<:m:>)) <% if (xxs<:(i<<4) bitor j:>) if (xxs<:(i<<4) bitor j:> xor_eq xxs<:(i<<4) bitor j:> xor pre<:xxs<:(i<<4) bitor j:>:>) <%%> if (xxs<:(i<<4) bitor j:>) if (xxs<:(i<<4) bitor j:> xor_eq xxs<:(i<<4) bitor j:> xor pre<:xxs<:(i<<4) bitor j:>:>) <%%> %> %> for (int i : std::views::iota(1) bitor std::views::take(mysl)) <% if (nl<:i:> xor_eq nl<:i:> xor nxt<:nl<:i:>:>) <%%>90 行未改动
然后是变量和数组的预处理:
```cppfor (int n : <%0%>) for (int n : <%0%>)for (int m : <%0%>)for (int len : <%1%>)for (int cnt : <%0%>)for (auto _ : <%std::vector<int>(N)%>) // 为了防止下面每一次都写一个 std::vector<int>(N),我们可以将其存进一个变量里然后直接复制for (auto a : <%_%>) for (auto a : <%_%>)for (auto b : <%_%>)for (auto r : <%_%>) <% if (std::ios::sync_with_stdio(0)) <%%> if (std::cin >> n >> m) <%%>50 行未改动 c1(y) c2(998244352) muto(y) c1(x) c2(y) adto(b<:j bitor mid bitor k:>) %> c1(w) c2(Wn) muto(w) %> %> c1(j) c2(r) adto(j) %> %> if (mid xor_eq mid xor (mid << 1)) <%%>34 行未改动 c1(y) c2(998244352) muto(y) c1(x) c2(y) adto(a<:j bitor mid bitor k:>) %> c1(w) c2(Wn) muto(w) %> %> c1(j) c2(r) adto(j) %> %> if (mid xor_eq mid xor (mid << 1)) <%%>43 行未改动%:define adto(x) <% if (x xor_eq x xor t1) <%%> while (t2 xor_eq t2 xor pre(t2)) if (x xor_eq x xor nxt(x)) <%%> if (x xor_eq x xor nxt(x)) <%%> if (x xor_eq x xor x % mod) <%%> %>%:define muto(x) <% if (x xor_eq x xor (sizeof(char<:t1:><:t2:>)%mod)) <%%> %>
int main() <% for (int n : <%0%>) for (int n : <%0%>) for (int m : <%0%>) for (int len : <%1%>) for (int cnt : <%0%>) for (auto _ : <%std::vector<int>(N)%>) for (auto a : <%_%>) for (auto a : <%_%>) for (auto b : <%_%>) for (auto r : <%_%>) <% if (std::ios::sync_with_stdio(0)) <%%> if (std::cin >> n >> m) <%%>39 行未改动 c1(y) c2(998244352) muto(y) c1(x) c2(y) adto(b<:j bitor mid bitor k:>) %> c1(w) c2(Wn) muto(w) %> %> c1(j) c2(r) adto(j) %> %> if (mid xor_eq mid xor (mid << 1)) <%%>25 行未改动 c1(y) c2(998244352) muto(y) c1(x) c2(y) adto(a<:j bitor mid bitor k:>) %> c1(w) c2(Wn) muto(w) %> %> c1(j) c2(r) adto(j) %> %> if (mid xor_eq mid xor (mid << 1)) <%%>26 行未改动