正文
增加 107 行删除 6 行
123456738 行未改动46474849505152535455567 行未改动6465666768697071725 行未改动787980818283允许语言:C/C++。:::::info[情景 1]禁止出现关键字和 `define`。简单。38 行未改动}```:::::::::::::::::info[情景2 ]禁止使用加号和减号。```cpp#include<bits/stdc++.h>7 行未改动cin>>a>>b;cout<<add(a,b);}```::::info[加强]禁止使用任何运算符。```cpp#include"stdio.h"#include"bits/stl_function.h"5 行未改动}```备注:`'\045'` 表示 `'%'`,因为 `'%'` 的 ascii 在八进制下是 $45$。:::::::::123456738 行未改动464748495051525354557 行未改动6364656667686970715 行未改动7778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184允许语言:C/C++,不允许内联汇编或 `system`。### 情景 1禁止出现关键字和 `define`。简单。38 行未改动}```:::::::### 情景2禁止使用加号和减号。```cpp#include<bits/stdc++.h>7 行未改动cin>>a>>b;cout<<add(a,b);}```::::info[加强]{open}禁止使用任何运算符。```cpp#include"stdio.h"#include"bits/stl_function.h"5 行未改动}```备注:`'\045'` 表示 `'%'`,因为 `'%'` 的 ascii 在八进制下是 $45$。:::error[加强]{open}不行了这个太抽象了。禁止使用这些符号:`+-*/!%^&*. ~=<>,`。不能使用 `scanf`/`printf`,因为 `,` 挂了。不能使用 `cin`/`cout` 或用 `cin`/`cout` 的内置函数,因为 `<>.` 挂了。不能使用 `plus`,因为 `,` 挂了。那么,手写快读/快写。`=` 挂了怎么办?没事我们先 `a and_eq 0`,再 `a or_eq b`,表示 `a=b`。加法怎么办?众所周知,`[]` 的本质是指针**加法**,那么给出 [LionBlaze](https://www.luogu.com.cn/user/911054) 大佬的代码:`(long long)bitand(((decltype(std::string().c_str()))(a))[b])`。不过 `std::string().c_str()` 太长了,且不能用 `.`,我们使用 `main(char v[])`,这时的 `v` 也是 `char*` 类型的。~~不过这个 main 函数是不是不太对?~~给出使用了空格代码,注意不能使用空格,头文件不能带 `.`:```cpp#include"cstdio"#include"cctype"#include"string"int a;int b;int c;main(char v[]){c and_eq 0;c or_eq getchar();if(not isdigit(c)){c and_eq 0;c or_eq getchar();while(isdigit(c)){int tmp(c xor 48);c and_eq 0;c or_eq std::negate()(tmp);int e((size_t)bitand(decltype(v)(a)[a]));int f((size_t)bitand(decltype(v)(e)[e]));int g((size_t)bitand(decltype(v)(f)[f]));int h((size_t)bitand(decltype(v)(e)[g]));int i((size_t)bitand(decltype(v)(h)[c]));a xor_eq i xor_eq a;c and_eq 0;c or_eq getchar();}}else while(isdigit(c)){c xor_eq 48;int e((size_t)bitand(decltype(v)(a)[a]));int f((size_t)bitand(decltype(v)(e)[e]));int g((size_t)bitand(decltype(v)(f)[f]));int h((size_t)bitand(decltype(v)(e)[g]));int i((size_t)bitand(decltype(v)(h)[c]));a xor_eq i xor_eq a;c and_eq 0;c or_eq getchar();}c and_eq 0;c or_eq getchar();if(not isdigit(c)){c and_eq 0;c or_eq getchar();while(isdigit(c)){int tmp(c xor 48);c and_eq 0;c or_eq std::negate()(tmp);int e((size_t)bitand(decltype(v)(b)[b]));int f((size_t)bitand(decltype(v)(e)[e]));int g((size_t)bitand(decltype(v)(f)[f]));int h((size_t)bitand(decltype(v)(e)[g]));int i((size_t)bitand(decltype(v)(h)[c]));b xor_eq i xor_eq b;c and_eq 0;c or_eq getchar();}}else while(isdigit(c)){c xor_eq 48;int e((size_t)bitand(decltype(v)(b)[b]));int f((size_t)bitand(decltype(v)(e)[e]));int g((size_t)bitand(decltype(v)(f)[f]));int h((size_t)bitand(decltype(v)(e)[g]));int i((size_t)bitand(decltype(v)(h)[c]));b xor_eq i xor_eq b;c and_eq 0;c or_eq getchar();}int ans((long long)bitand(((decltype(v))(a))[b]));for(char x:std::to_string(ans))putchar(x);}```把空格全部替换为换行即可。:::::::未完待续。